Skip to content

Commit 20fb824

Browse files
committed
Fix all styled components keyframes breaking changes
1 parent 87353e3 commit 20fb824

File tree

2 files changed

+42
-39
lines changed

2 files changed

+42
-39
lines changed

packages/app/src/app/components/ModeIcons/elements.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled, { keyframes } from 'styled-components';
1+
import styled, { keyframes, css } from 'styled-components';
22

33
const showAnimationKeyframes = keyframes`
44
0% { opacity: 0; transform: translateX(10px); }
@@ -11,10 +11,11 @@ const reverseShowAnimationKeyframes = keyframes`
1111
`;
1212

1313
const showAnimation = (delay: number = 0, reverse: boolean = true) =>
14-
`
15-
animation: ${
16-
reverse ? reverseShowAnimationKeyframes : showAnimationKeyframes
17-
} 0.3s;
14+
css`
15+
animation: ${reverse
16+
? reverseShowAnimationKeyframes
17+
: showAnimationKeyframes}
18+
0.3s;
1819
animation-delay: ${delay}s;
1920
animation-fill-mode: forwards;
2021
opacity: 0;
@@ -31,10 +32,11 @@ const reverseHideAnimationKeyframes = keyframes`
3132
`;
3233

3334
const hideAnimation = (delay: number = 0, reverse: boolean = true) =>
34-
`
35-
animation: ${
36-
reverse ? reverseHideAnimationKeyframes : hideAnimationKeyframes
37-
} 0.3s;
35+
css`
36+
animation: ${reverse
37+
? reverseHideAnimationKeyframes
38+
: hideAnimationKeyframes}
39+
0.3s;
3840
animation-delay: ${delay}s;
3941
animation-fill-mode: forwards;
4042
opacity: 1;

packages/app/src/app/pages/Sandbox/Editor/Header/Action/elements.js

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled, { keyframes } from 'styled-components';
1+
import styled, { keyframes, css } from 'styled-components';
22
import { Link } from 'react-router-dom';
33
import Tooltip from 'common/components/Tooltip';
44

@@ -13,10 +13,10 @@ const blink = keyframes`
1313
const styles = props =>
1414
`
1515
${props.blink &&
16-
`
17-
animation: ${blink} 1s infinite;
18-
font-weight: 600;
19-
`}
16+
css`
17+
animation: ${blink} 1s infinite;
18+
font-weight: 600;
19+
`}
2020
2121
display: flex !important;
2222
transition: 0.3s ease all;
@@ -33,25 +33,24 @@ const styles = props =>
3333
z-index: 1;
3434
${
3535
props.highlight
36-
? `
37-
background-color: ${props.theme.secondary.darken(0.1)()};
38-
color: rgba(255, 255, 255, 0.7);
39-
border-bottom: 1px solid ${props.theme.secondary.darken(0.1)()};
36+
? css`
37+
background-color: ${props.theme.secondary.darken(0.1)()};
38+
color: rgba(255, 255, 255, 0.7);
39+
border-bottom: 1px solid ${props.theme.secondary.darken(0.1)()};
4040
41-
&:hover {
42-
background-color: ${props.theme.secondary.darken(0.2)()};
43-
}
44-
`
45-
: `
46-
47-
&:hover {
48-
color: ${props.theme['editor.foreground'] ||
49-
(props.theme.light ? 'black' : 'white')};
50-
border-color: ${
51-
props.hideBottomHighlight ? 'transparent' : props.theme.secondary()
52-
}
53-
}
54-
`
41+
&:hover {
42+
background-color: ${props.theme.secondary.darken(0.2)()};
43+
}
44+
`
45+
: css`
46+
&:hover {
47+
color: ${props.theme['editor.foreground'] ||
48+
(props.theme.light ? 'black' : 'white')};
49+
border-color: ${props.hideBottomHighlight
50+
? 'transparent'
51+
: props.theme.secondary()};
52+
}
53+
`
5554
}
5655
`;
5756

@@ -77,14 +76,16 @@ export const ActionTooltip = styled(Tooltip)`
7776
${styles};
7877
${props =>
7978
props.disabledAction &&
80-
`
81-
color: ${props.theme.light ? 'rgba(0,0,0,0.3)' : 'rgba(255,255,255,0.3)'};
82-
cursor: default;
79+
css`
80+
color: ${props.theme.light ? 'rgba(0,0,0,0.3)' : 'rgba(255,255,255,0.3)'};
81+
cursor: default;
8382
84-
&:hover {
85-
color: ${props.theme.light ? 'rgba(0,0,0,0.4)' : 'rgba(255,255,255,0.4)'};
86-
}
87-
`};
83+
&:hover {
84+
color: ${props.theme.light
85+
? 'rgba(0,0,0,0.4)'
86+
: 'rgba(255,255,255,0.4)'};
87+
}
88+
`};
8889
`;
8990

9091
export const IconContainer = styled.div`

0 commit comments

Comments
 (0)