-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dynamic rootValue in css file not work
- Loading branch information
1 parent
11bbece
commit 6cac2fa
Showing
33 changed files
with
1,744 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.d1 { | ||
font-size: 16px; | ||
} | ||
|
||
/* pxtorem?rootValue=32 */ | ||
.d2 { | ||
font-size: 16px; | ||
} | ||
|
||
/* pxtorem?rootValue=8 */ | ||
.d3 { | ||
font-size: 16px; | ||
} | ||
|
||
.d4 { | ||
font-size: 16px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import styles from './index.module.css' | ||
|
||
const D = () => { | ||
return ( | ||
<div className={'box'}> | ||
<div id='d_1' className={styles.d1}> | ||
这是在css文件中不修改rootValue的16px | ||
</div> | ||
<div id='d_2' className={styles.d2}> | ||
这是在css文件中动态修改rootValue为32px后的16px(缩小一倍) | ||
</div> | ||
<div id='d_3' className={styles.d3}> | ||
这是在css文件中动态修改rootValue为8px后的16px(放大一倍) | ||
</div> | ||
<div id='d_4' className={styles.d4}> | ||
放大一倍 | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.e1 { | ||
font-size: 16px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import styles from './index.module.css' | ||
|
||
const E = () => { | ||
return ( | ||
<div className={'box'}> | ||
<div id='e_1' className={styles.e1}> | ||
1rem | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default E |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
@tailwind base; | ||
|
||
@tailwind components; | ||
|
||
@tailwind utilities; | ||
|
||
@tailwind variants; | ||
|
||
.box { | ||
@apply flex flex-col border-2 rounded-lg p-[8px] border-zinc-400; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>pxtorem playground</title> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "vite-project", | ||
"version": "0.0.0", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "npm run build && vite preview" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.3.2", | ||
"modern-flexible": "^0.0.3", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-use": "^17.4.0" | ||
}, | ||
"devDependencies": { | ||
"@minko-fe/postcss-pxtorem": "workspace:*", | ||
"@types/react": "^18.0.29", | ||
"@types/react-dom": "^18.0.11", | ||
"@vitejs/plugin-react": "^3.1.0", | ||
"postcss": "^8.4.21", | ||
"tailwindcss": "^3.2.7", | ||
"typescript": "^4.9.5", | ||
"vite": "^4.4.9", | ||
"vite-plugin-public-typescript": "^1.5.5" | ||
} | ||
} |
Oops, something went wrong.