forked from carbon-design-system/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.scss
123 lines (107 loc) · 2.96 KB
/
index.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//
// Copyright IBM Corp. 2018, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//
@use 'sass:map';
/// Common component easings
/// @type Map
/// @access public
/// @group @carbon/motion
$easings: (
standard: (
productive: cubic-bezier(0.2, 0, 0.38, 0.9),
expressive: cubic-bezier(0.4, 0.14, 0.3, 1),
),
entrance: (
productive: cubic-bezier(0, 0, 0.38, 0.9),
expressive: cubic-bezier(0, 0, 0.3, 1),
),
exit: (
productive: cubic-bezier(0.2, 0, 1, 0.9),
expressive: cubic-bezier(0.4, 0.14, 1, 1),
),
);
/// Get the transition-timing-function for a given easing and motion mode
/// @param {String} $name - Can be `standard`, `entrance`, or `exit`
/// @param {String} $mode [productive] - Can be `productive` or `expressive`
/// @param {Map} $easings [$carbon--easings] - Easings map
/// @access public
/// @group @carbon/motion
/// @return {Function} CSS `cubic-bezier()` function
@function motion($name, $mode: productive, $easings: $easings) {
@if map.has-key($easings, $name) {
$easing: map.get($easings, $name);
@if map.has-key($easing, $mode) {
@return map.get($easing, $mode);
} @else {
@error 'Unable to find a mode for the easing #{$easing} called: #{$mode}.';
}
} @else {
@error 'Unable to find an easing named #{$name} in our supported easings.';
}
}
/// Set the transition-timing-function for a given easing and motion mode
/// @param {String} $name - The name of the easing curve to apply
/// @param {String} $mode - The mode for the easing curve to use
/// @access public
/// @group @carbon/motion
@mixin motion($name, $mode) {
transition-timing-function: motion($name, $mode);
}
/// @access public
/// @type Duration
/// @group @carbon/motion
$duration-fast-01: 70ms;
/// @access public
/// @type Duration
/// @group @carbon/motion
$duration-fast-02: 110ms;
/// @access public
/// @type Duration
/// @group @carbon/motion
$duration-moderate-01: 150ms;
/// @access public
/// @type Duration
/// @group @carbon/motion
$duration-moderate-02: 240ms;
/// @access public
/// @type Duration
/// @group @carbon/motion
$duration-slow-01: 400ms;
/// @access public
/// @type Duration
/// @group @carbon/motion
$duration-slow-02: 700ms;
/// V10 backwards compatibility tokens
/// @access public
/// @deprecated
/// @type Duration
/// @group @carbon/motion
$fast-01: $duration-fast-01;
/// @access public
/// @deprecated
/// @type Duration
/// @group @carbon/motion
$fast-02: $duration-fast-02;
/// @access public
/// @deprecated
/// @type Duration
/// @group @carbon/motion
$moderate-01: $duration-moderate-01;
/// @access public
/// @deprecated
/// @type Duration
/// @group @carbon/motion
$moderate-02: $duration-moderate-02;
/// @access public
/// @deprecated
/// @type Duration
/// @group @carbon/motion
$slow-01: $duration-slow-01;
/// @access public
/// @deprecated
/// @type Duration
/// @group @carbon/motion
$slow-02: $duration-slow-02;