1 | //
|
2 | // Copyright IBM Corp. 2016, 2018
|
3 | //
|
4 | // This source code is licensed under the Apache-2.0 license found in the
|
5 | // LICENSE file in the root directory of this source tree.
|
6 | //
|
7 |
|
8 | @import './vendor/@carbon/elements/scss/motion/motion';
|
9 |
|
10 | /// Used primarily for removing elements from the screen.
|
11 | /// @access public
|
12 | $carbon--ease-in: cubic-bezier(0.25, 0, 1, 1);
|
13 |
|
14 | /// Used for adding elements to the screen or changing on-screen states at a users's input.
|
15 | /// @access public
|
16 | $carbon--ease-out: cubic-bezier(0, 0, 0.25, 1);
|
17 |
|
18 | /// Used for the majority of animations.
|
19 | /// @access public
|
20 | $carbon--standard-easing: cubic-bezier(0.5, 0, 0.1, 1);
|
21 |
|
22 | /// Base transition duration
|
23 | /// @access public
|
24 | $transition--base: 250ms;
|
25 |
|
26 | /// Expansion duration
|
27 | /// @access public
|
28 | $transition--expansion: 300ms;
|
29 |
|
30 | /// New easing durations
|
31 | $duration--fast-01: 70ms;
|
32 | $duration--fast-02: 110ms;
|
33 | $duration--moderate-01: 150ms;
|
34 | $duration--moderate-02: 240ms;
|
35 | $duration--slow-01: 400ms;
|
36 | $duration--slow-02: 720ms;
|
37 |
|
38 | // ☠️ Deprecated
|
39 |
|
40 | /// Default ease-in for components
|
41 | /// @access public
|
42 | /// @deprecated Updated to `$carbon--ease-in`
|
43 | $bx--ease-in: $carbon--ease-in;
|
44 |
|
45 | /// Default ease-out for components
|
46 | /// @access public
|
47 | /// @deprecated Updated to `$carbon--ease-out`
|
48 | $bx--ease-out: $carbon--ease-out;
|
49 |
|
50 | /// Standard easing for components
|
51 | /// @access public
|
52 | /// @deprecated Updated to `$carbon--standard-easing`
|
53 | $bx--standard-easing: $carbon--standard-easing;
|
54 |
|
55 | @if feature-flag-enabled('components-x') {
|
56 | $carbon--ease-in: cubic-bezier(0, 0, 0.38, 0.9);
|
57 | $carbon--ease-out: cubic-bezier(0.2, 0, 1, 0.9);
|
58 | $carbon--standard-easing: cubic-bezier(0.2, 0, 0.38, 0.9);
|
59 |
|
60 | $transition--base: $duration--fast-02;
|
61 | $transition--expansion: $duration--moderate-02;
|
62 | }
|
63 |
|
64 | /// Get the transition-timing-function for a given easing and motion mode.
|
65 | /// Easings that are currently supported include: standard, entrance, and exit.
|
66 | /// We also offer two modes: productive and expressive.
|
67 | /// @access public
|
68 | /// @param {String} $name - the name of the easing curve to apply
|
69 | /// @param {String} $mode - the mode for the easing curve to use
|
70 | /// @return {cubic-bezier}
|
71 | @function motion($name, $mode: productive, $easings: $carbon--easings) {
|
72 | @return carbon--motion($name, $mode, $easings);
|
73 | }
|
74 |
|
75 | /// Get the transition-timing-function for a given easing and motion mode.
|
76 | /// Easings that are currently supported include: standard, entrance, and exit.
|
77 | /// We also offer two modes: productive and expressive.
|
78 | /// @access public
|
79 | /// @param {String} $name - the name of the easing curve to apply
|
80 | /// @param {String} $mode - the mode for the easing curve to use
|
81 | /// @return {cubic-bezier}
|
82 | @mixin motion($name, $mode) {
|
83 | @include carbon--motion($name, $mode);
|
84 | }
|