Skip to content

Commit 7e2b03a

Browse files
committed
stylistic changes to variable name and clean up comment
1 parent 6745de6 commit 7e2b03a

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/runtime/internal/transitions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ export function create_in_transition(node: Element & ElementCSSInlineStyle, fn:
8989
easing = linear,
9090
tick = noop,
9191
css,
92-
staticCss,
92+
static_css
9393
} = config || null_transition;
9494

95-
if (staticCss) static_class_name = create_static_rule(node, staticCss, uid++);
95+
if (static_css) static_class_name = create_static_rule(node, static_css, uid++);
9696
if (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
9797
tick(0, 1);
9898

@@ -272,7 +272,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
272272
easing = linear,
273273
tick = noop,
274274
css,
275-
staticCss
275+
static_css
276276
} = config || null_transition;
277277

278278
const program = {
@@ -291,8 +291,8 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
291291
} else {
292292
// if this is an intro, and there's a delay, we need to do
293293
// an initial tick and/or apply CSS animation immediately
294-
if (staticCss && !static_class_name) {
295-
static_class_name = create_static_rule(node, staticCss);
294+
if (static_css && !static_class_name) {
295+
static_class_name = create_static_rule(node, static_css);
296296
}
297297
if (css) {
298298
clear_animation();

src/runtime/transition/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { assign, is_function } from 'svelte/internal';
44
type EasingFunction = (t: number) => number;
55

66
export interface TransitionConfig {
7+
static_css?: string;
78
delay?: number;
89
duration?: number;
910
easing?: EasingFunction;
1011
css?: (t: number, u: number) => string;
11-
staticCss?: string;
1212
tick?: (t: number, u: number) => void;
1313
}
1414

@@ -117,17 +117,16 @@ export function slide(node: Element, {
117117
const border_bottom_width = parseFloat(style.borderBottomWidth);
118118

119119
let displayOverride = '';
120-
// May want to use a whitelist instead
121120
if (style.display.includes('table')) {
122121
displayOverride = 'display: block;';
123122
}
124123

125124
return {
126-
// Support a custom className to be added before and cleaned up after the thing.
127-
staticCss: displayOverride + 'overflow: hidden;',
128125
delay,
129126
duration,
130127
easing,
128+
static_css: displayOverride +
129+
'overflow: hidden;',
131130
css: t =>
132131
`opacity: ${Math.min(t * 20, 1) * opacity};` +
133132
`height: ${t * height}px;` +

0 commit comments

Comments
 (0)