-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rydd opp i plassering og navn blant motion-funksjoner
BREAKING CHANGE: Maps fra motion er gjort private, jkl-motion er nå easing, jkl-timing er nå timing.
- Loading branch information
Showing
7 changed files
with
51 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@use "sass:map"; | ||
|
||
$_easings: ( | ||
"standard": ease, | ||
"entrance": ease-out, | ||
"exit": ease-in, | ||
"easeInBounceOut": cubic-bezier(0, 0, 0.375, 1.17), | ||
); | ||
|
||
@function easing($name, $easings: $_easings) { | ||
@if map.has-key($easings, $name) { | ||
@return map.get($easings, $name); | ||
} @else { | ||
@error 'Unable to find an easing named #{$name} in our supported easings.'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
@forward "convert"; | ||
@forward "easing"; | ||
@forward "timing"; | ||
@forward "responsive-units"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@use "sass:map"; | ||
|
||
$_timings: ( | ||
"energetic": 75ms, | ||
"productive": 150ms, | ||
"expressive": 250ms, | ||
"lazy": 400ms, | ||
); | ||
|
||
@function timing($mode, $timings: $_timings) { | ||
@if map.has-key($timings, $mode) { | ||
@return map.get($timings, $mode); | ||
} @else { | ||
@error 'Unable to find a mode for #{$mode}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,6 @@ | ||
$jkl--easings: ( | ||
"standard": ease, | ||
"entrance": ease-out, | ||
"exit": ease-in, | ||
"easeInBounceOut": cubic-bezier(0, 0, 0.375, 1.17), | ||
); | ||
|
||
$jkl--timings: ( | ||
"energetic": 75ms, | ||
"productive": 150ms, | ||
"expressive": 250ms, | ||
"lazy": 400ms, | ||
); | ||
|
||
@function jkl-motion($name, $easings: $jkl--easings) { | ||
@if map-has-key($easings, $name) { | ||
@return map-get($easings, $name); | ||
} @else { | ||
@error 'Unable to find an easing named #{$name} in our supported easings.'; | ||
} | ||
} | ||
|
||
@function jkl-timing($mode, $timings: $jkl--timings) { | ||
@if map-has-key($timings, $mode) { | ||
@return map-get($timings, $mode); | ||
} @else { | ||
@error 'Unable to find a mode for #{$mode}'; | ||
} | ||
} | ||
@use "../functions"; | ||
|
||
@mixin motion($name: "standard", $mode: "productive") { | ||
transition-timing-function: jkl-motion($name); | ||
transition-duration: jkl-timing($mode); | ||
transition-timing-function: functions.easing($name); | ||
transition-duration: functions.timing($mode); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters