mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
Merge pull request #170 from locomotivemtl/feature/config-speed
Rename `timing` by `speed`
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": 1711479720413
|
||||
"version": 1711479960586
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
@import "settings/config.eases";
|
||||
@import "settings/config.fonts";
|
||||
@import "settings/config.spacings";
|
||||
@import "settings/config.timings";
|
||||
@import "settings/config.speeds";
|
||||
@import "settings/config.zindexes";
|
||||
@import "settings/config.variables";
|
||||
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
// ==========================================================================
|
||||
// Settings / Config / Timings
|
||||
// Settings / Config / Speeds
|
||||
// ==========================================================================
|
||||
|
||||
// Timings
|
||||
// Speeds
|
||||
// ==========================================================================
|
||||
|
||||
$timings: (
|
||||
$speeds: (
|
||||
fastest: 0.1s,
|
||||
faster: 0.15s,
|
||||
fast: 0.25s,
|
||||
normal: 0.5s,
|
||||
slow: 0.75s,
|
||||
slower: 1s,
|
||||
slowest: 2s,
|
||||
normal: 0.3s,
|
||||
slow: 0.5s,
|
||||
slower: 0.75s,
|
||||
slowest: 1s,
|
||||
);
|
||||
|
||||
// Default timing for t()
|
||||
$timing-default: "normal" !default;
|
||||
|
||||
// Function
|
||||
// ==========================================================================
|
||||
|
||||
@@ -25,17 +22,17 @@ $timing-default: "normal" !default;
|
||||
//
|
||||
// ```scss
|
||||
// .c-box {
|
||||
// transition-duration: t(slow);
|
||||
// transition-duration: speed(slow);
|
||||
// }
|
||||
// ```
|
||||
//
|
||||
// @param {string} $key - The timing key in $timings.
|
||||
// @param {string} $key - The speed key in $speeds.
|
||||
// @return {duration}
|
||||
|
||||
@function t($key: $timing-default) {
|
||||
@if not map-has-key($timings, $key) {
|
||||
@error "Unknown '#{$key}' in $timings.";
|
||||
@function speed($key: "normal") {
|
||||
@if not map-has-key($speeds, $key) {
|
||||
@error "Unknown '#{$key}' in $speeds.";
|
||||
}
|
||||
|
||||
@return map-get($timings, $key);
|
||||
@return map-get($speeds, $key);
|
||||
}
|
||||
Reference in New Issue
Block a user