Skip to content

Commit f6308aa

Browse files
Inneicursoragent
andcommitted
♻️ refactor(styles): extract fadeIn animation to animations.ts
Extracts the `fadeIn` animation keyframes into a shared `src/styles/animations.ts` file to reduce duplication in `SyntaxHighlighter` and `SyntaxMarkdown`. Files updated: - src/styles/animations.ts (new) - src/Highlighter/SyntaxHighlighter/style.ts - src/Markdown/SyntaxMarkdown/style.ts Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 0a0ea88 commit f6308aa

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

src/Highlighter/SyntaxHighlighter/style.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
import { createStaticStyles, cx, keyframes } from 'antd-style';
1+
import { createStaticStyles, cx } from 'antd-style';
22
import { cva } from 'class-variance-authority';
33

4-
const fadeIn = keyframes`
5-
0% {
6-
opacity: 0;
7-
}
8-
100% {
9-
opacity: 1;
10-
}
11-
`;
4+
import { fadeIn } from '@/styles/animations';
125

136
export const styles = createStaticStyles(({ css, cssVar }) => {
147
return {

src/Markdown/SyntaxMarkdown/style.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
import { createStaticStyles, keyframes } from 'antd-style';
1+
import { createStaticStyles } from 'antd-style';
22

3-
const fadeIn = keyframes`
4-
0% {
5-
opacity: 0;
6-
}
7-
100% {
8-
opacity: 1;
9-
}
10-
`;
3+
import { fadeIn } from '@/styles/animations';
114

125
export const styles = createStaticStyles(({ css }) => {
136
return {

src/styles/animations.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { keyframes } from 'antd-style';
2+
3+
export const fadeIn = keyframes`
4+
0% {
5+
opacity: 0;
6+
}
7+
100% {
8+
opacity: 1;
9+
}
10+
`;

0 commit comments

Comments
 (0)