Skip to content

Commit 132ccd4

Browse files
authored
Replace @te-* and related Less variables (#897)
1 parent 0043050 commit 132ccd4

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

lib/css/atomic/_stacks-misc.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@
316316

317317
// -- Provide a sensible default
318318
.t {
319-
transition-duration: @transition-time;
319+
transition-duration: var(--transition-time);
320320
transition-property: all;
321-
transition-timing-function: @te-ease-in;
321+
transition-timing-function: var(--te-ease-in);
322322
transition-delay: 0s;
323323
}
324324

lib/css/components/_stacks-buttons.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@
604604
vertical-align: baseline;
605605
margin-top: -0.3em; // [1]
606606
margin-bottom: -0.3em; // [1]
607-
transition: opacity 200ms @te-smooth; // Animate the transition to .is-loading
607+
transition: opacity 200ms var(--te-smooth); // Animate the transition to .is-loading
608608
}
609609
}
610610

lib/css/components/_stacks-modals.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
background-color: fade(@black-900, 50%); // Background remains fixed
3030
opacity: 0;
3131
backface-visibility: hidden;
32-
transition: opacity 100ms @te-smooth 0s, z-index 0s 100ms, visibility 0s 100ms; // Transition out
32+
transition: opacity 100ms var(--te-smooth) 0s, z-index 0s 100ms, visibility 0s 100ms; // Transition out
3333
will-change: visibility, z-index, opacity; // Not supported in Edge
3434

3535
&[aria-hidden="false"],
@@ -38,7 +38,7 @@
3838
z-index: var(--zi-modals);
3939
opacity: 1;
4040
transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
41-
transition: opacity 100ms @te-smooth 10ms, z-index 0s 0s, visibility 0s 0s, transform 100ms @te-smooth 10ms, transform 100ms @te-smooth 10ms; // Transition in
41+
transition: opacity 100ms var(--te-smooth) 10ms, z-index 0s 0s, visibility 0s 0s, transform 100ms var(--te-smooth) 10ms, transform 100ms var(--te-smooth) 10ms; // Transition in
4242
}
4343
}
4444

@@ -62,7 +62,7 @@
6262

6363
@scrollbar-styles();
6464

65-
transition: opacity 200ms @te-smooth 0s, z-index 0s 100ms, visibility 0s 100ms, transform 100ms @te-smooth 0s, transform 100ms @te-smooth 0s; // Transition out
65+
transition: opacity 200ms var(--te-smooth) 0s, z-index 0s 100ms, visibility 0s 100ms, transform 100ms var(--te-smooth) 0s, transform 100ms var(--te-smooth) 0s; // Transition out
6666
will-change: visibility, z-index, opacity, transform; // Not supported by Edge
6767

6868
.s-modal[aria-hidden="false"] & {

lib/css/components/_stacks-notices.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@
217217
opacity: 0;
218218
z-index: calc(var(--zi-modals) + 1); // Toasts should appear above modals
219219
transform: translate3d(0, -66px, 0);
220-
transition: transform 100ms @te-smooth-slow 0s, opacity 60ms @te-smooth-slow 0ms, visibility 0s 150ms;
220+
transition: transform 100ms var(--te-smooth-slow) 0s, opacity 60ms var(--te-smooth-slow) 0ms, visibility 0s 150ms;
221221
pointer-events: none;
222222

223223
&[aria-hidden="false"] {
224224
visibility: visible;
225225
opacity: 1;
226226
transform: translate3d(0, 0, 0);
227-
transition: visibility 0s 0s, opacity 100ms @te-smooth 0s, transform 100ms @te-smooth 0s;
227+
transition: visibility 0s 0s, opacity 100ms var(--te-smooth) 0s, transform 100ms var(--te-smooth) 0s;
228228
}
229229

230230
@media (prefers-reduced-motion) {

lib/css/components/_stacks-topbar.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
position: absolute;
289289
top: calc(50% - 14px);
290290
right: 2px;
291-
transition: top @te-smooth 0.15s;
291+
transition: top var(--te-smooth) 0.15s;
292292
}
293293
}
294294

lib/css/exports/_stacks-constants-helpers.less

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,19 @@ body {
8181
// ============================================================================
8282
// $ TRANSITION EASINGS (te-)
8383
// ----------------------------------------------------------------------------
84-
@te-smooth-slow: cubic-bezier(0.25, 0.46, 0.45, 0.94); // easeOutQuad
85-
@te-smooth: cubic-bezier(0.165, 0.84, 0.44, 1); // easeOutQuart
86-
@te-smooth-quick: cubic-bezier(0.19, 1, 0.22, 1); // easeOutExpo
87-
@te-back-out: cubic-bezier(0.175, 0.885, 0.32, 1.275); // easeOutBack
88-
@te-back-in-out: cubic-bezier(0.68, -0.55, 0.265, 1.55); // easeInOutBack
89-
@te-ease-in: cubic-bezier(0.47, 0, 0.745, 0.715); // easeIn
90-
@te-ease-in-out: cubic-bezier(0.445, 0.05, 0.55, 0.95); // easeInOut
91-
@te-ease-out: cubic-bezier(0.39, 0.575, 0.565, 1); // easeOut
92-
93-
@default-transition-duration: 0.1s;
94-
@transition-time: @default-transition-duration;
95-
84+
body {
85+
--te-smooth-slow: cubic-bezier(0.25, 0.46, 0.45, 0.94); // easeOutQuad
86+
--te-smooth: cubic-bezier(0.165, 0.84, 0.44, 1); // easeOutQuart
87+
--te-smooth-quick: cubic-bezier(0.19, 1, 0.22, 1); // easeOutExpo
88+
--te-back-out: cubic-bezier(0.175, 0.885, 0.32, 1.275); // easeOutBack
89+
--te-back-in-out: cubic-bezier(0.68, -0.55, 0.265, 1.55); // easeInOutBack
90+
--te-ease-in: cubic-bezier(0.47, 0, 0.745, 0.715); // easeIn
91+
--te-ease-in-out: cubic-bezier(0.445, 0.05, 0.55, 0.95); // easeInOut
92+
--te-ease-out: cubic-bezier(0.39, 0.575, 0.565, 1); // easeOut
93+
94+
--default-transition-duration: 0.1s;
95+
--transition-time: var(--default-transition-duration);
96+
}
9697

9798
// ============================================================================
9899
// $ SCROLLBAR STYLING

0 commit comments

Comments
 (0)