Skip to content

Commit 489d6ab

Browse files
committed
Implement reset css
1 parent 2348231 commit 489d6ab

File tree

19 files changed

+673
-63
lines changed

19 files changed

+673
-63
lines changed

.changeset/breezy-ghosts-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@devup-ui/reset-css": major
3+
---
4+
5+
reset css

apps/landing/next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ export default withMDX(
1515
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
1616
output: 'export',
1717
},
18-
{ include: ['@devup-ui/components'] },
18+
{ include: ['@devup-ui/components', '@devup-ui/reset-css'] },
1919
),
2020
)

apps/landing/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"dependencies": {
1414
"@devup-ui/components": "workspace:*",
1515
"@devup-ui/react": "workspace:*",
16+
"@devup-ui/reset-css": "workspace:*",
1617
"@mdx-js/loader": "^3.1.0",
1718
"@mdx-js/react": "^3.1.0",
1819
"@next/mdx": "^15.3.5",
@@ -24,8 +25,7 @@
2425
"react-dom": "^19.1.0",
2526
"react-markdown": "^10.1.0",
2627
"react-syntax-highlighter": "^15.6.1",
27-
"remark-gfm": "^4.0.1",
28-
"sanitize.css": "^13.0.0"
28+
"remark-gfm": "^4.0.1"
2929
},
3030
"devDependencies": {
3131
"@devup-ui/next-plugin": "workspace:*",

apps/landing/src/app/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import 'sanitize.css'
2-
31
import { css, globalCss, ThemeScript } from '@devup-ui/react'
2+
import { resetCss } from '@devup-ui/reset-css'
43
import type { Metadata } from 'next'
54

65
import { Footer } from '../components/Footer'
@@ -24,6 +23,8 @@ export const metadata: Metadata = {
2423
},
2524
}
2625

26+
resetCss()
27+
2728
globalCss({
2829
imports: ['https://cdn.jsdelivr.net/gh/joungkyun/font-d2coding/d2coding.css'],
2930
table: {

libs/extractor/src/extract_style/constant.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ pub(super) static MAINTAIN_VALUE_PROPERTIES: phf::Set<&str> = phf_set! {
1818
"gridRow",
1919
"gridRowStart",
2020
"gridRowEnd",
21-
"animationIterationCount"
21+
"animationIterationCount",
22+
"tabSize",
23+
"MozTabSize"
2224
};

libs/extractor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2531,7 +2531,7 @@ e(o, { className: "a", bg: variable, style: { color: "blue" }, ...props })
25312531
extract(
25322532
"test.jsx",
25332533
r#"import {Flex} from '@devup-ui/core'
2534-
<Flex opacity={1} zIndex={2} fontWeight={900} scale={2} flex={1} lineHeight={1} />
2534+
<Flex opacity={1} zIndex={2} fontWeight={900} scale={2} flex={1} lineHeight={1} tabSize={4} MozTabSize={4} />
25352535
"#,
25362536
ExtractOption {
25372537
package: "@devup-ui/core".to_string(),

libs/extractor/src/snapshots/extractor__tests__maintain_value.snap

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
---
22
source: libs/extractor/src/lib.rs
3-
expression: "ToBTreeSet::from(extract(\"test.jsx\",\nr#\"import {Flex} from '@devup-ui/core'\n <Flex opacity={1} zIndex={2} fontWeight={900} scale={2} flex={1} lineHeight={1} />\n \"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())"
3+
expression: "ToBTreeSet::from(extract(\"test.jsx\",\nr#\"import {Flex} from '@devup-ui/core'\n <Flex opacity={1} zIndex={2} fontWeight={900} scale={2} flex={1} lineHeight={1} tabSize={4} MozTabSize={4} />\n \"#,\nExtractOption\n{ package: \"@devup-ui/core\".to_string(), css_file: None }).unwrap())"
44
---
55
ToBTreeSet {
66
styles: {
7+
Static(
8+
ExtractStaticStyle {
9+
property: "MozTabSize",
10+
value: "4",
11+
level: 0,
12+
selector: None,
13+
style_order: None,
14+
},
15+
),
716
Static(
817
ExtractStaticStyle {
918
property: "display",
@@ -60,6 +69,15 @@ ToBTreeSet {
6069
style_order: None,
6170
},
6271
),
72+
Static(
73+
ExtractStaticStyle {
74+
property: "tabSize",
75+
value: "4",
76+
level: 0,
77+
selector: None,
78+
style_order: None,
79+
},
80+
),
6381
Static(
6482
ExtractStaticStyle {
6583
property: "zIndex",
@@ -70,5 +88,5 @@ ToBTreeSet {
7088
},
7189
),
7290
},
73-
code: "import \"@devup-ui/core/devup-ui.css\";\n<div className=\"d0 d1 d2 d3 d4 d5 d6\" />;\n",
91+
code: "import \"@devup-ui/core/devup-ui.css\";\n<div className=\"d0 d1 d2 d3 d4 d5 d6 d7 d8\" />;\n",
7492
}

packages/react/src/__tests__/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('export', () => {
1414

1515
css: expect.any(Function),
1616
globalCss: expect.any(Function),
17+
keyframes: expect.any(Function),
1718

1819
ThemeScript: expect.any(Function),
1920

packages/react/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ export { css } from './utils/css'
1616
export { getTheme } from './utils/get-theme'
1717
export { globalCss } from './utils/global-css'
1818
export { initTheme } from './utils/init-theme'
19+
export { keyframes } from './utils/keyframes'
1920
export { setTheme } from './utils/set-theme'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { keyframes } from '../keyframes'
2+
3+
describe('keyframes', () => {
4+
it('should return animation', () => {
5+
expect(() =>
6+
keyframes({
7+
from: {
8+
opacity: 0,
9+
},
10+
to: {
11+
opacity: 1,
12+
},
13+
}),
14+
).toThrowError('Cannot run on the runtime')
15+
expect(() => keyframes`from{opacity:0}to{opacity:1}`).toThrowError(
16+
'Cannot run on the runtime',
17+
)
18+
})
19+
})

0 commit comments

Comments
 (0)