2023-06-08 11:48:00 +02:00
|
|
|
// ==========================================================================
|
2024-03-26 14:37:11 -04:00
|
|
|
// Settings / Config / Speeds
|
2023-06-08 11:48:00 +02:00
|
|
|
// ==========================================================================
|
|
|
|
|
|
2024-03-26 14:37:11 -04:00
|
|
|
// Speeds
|
2023-06-08 11:48:00 +02:00
|
|
|
// ==========================================================================
|
|
|
|
|
|
2024-03-26 14:37:11 -04:00
|
|
|
$speeds: (
|
2023-06-08 11:48:00 +02:00
|
|
|
fastest: 0.1s,
|
|
|
|
|
faster: 0.15s,
|
|
|
|
|
fast: 0.25s,
|
2024-03-26 14:37:11 -04:00
|
|
|
normal: 0.3s,
|
|
|
|
|
slow: 0.5s,
|
|
|
|
|
slower: 0.75s,
|
|
|
|
|
slowest: 1s,
|
2023-06-08 11:48:00 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Function
|
|
|
|
|
// ==========================================================================
|
|
|
|
|
|
|
|
|
|
// Returns timing.
|
|
|
|
|
//
|
|
|
|
|
// ```scss
|
|
|
|
|
// .c-box {
|
2024-03-26 14:37:11 -04:00
|
|
|
// transition-duration: speed(slow);
|
2023-06-08 11:48:00 +02:00
|
|
|
// }
|
|
|
|
|
// ```
|
|
|
|
|
//
|
2024-03-26 14:37:11 -04:00
|
|
|
// @param {string} $key - The speed key in $speeds.
|
2023-06-08 11:48:00 +02:00
|
|
|
// @return {duration}
|
|
|
|
|
|
2024-03-26 14:37:11 -04:00
|
|
|
@function speed($key: "normal") {
|
|
|
|
|
@if not map-has-key($speeds, $key) {
|
|
|
|
|
@error "Unknown '#{$key}' in $speeds.";
|
2023-06-08 11:48:00 +02:00
|
|
|
}
|
|
|
|
|
|
2024-03-26 14:37:11 -04:00
|
|
|
@return map-get($speeds, $key);
|
2023-06-08 11:48:00 +02:00
|
|
|
}
|