Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add global scss #2798

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/nutui-taro-demo/src/app.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../src/styles/jd-font.scss';
oasis-cloud marked this conversation as resolved.
Show resolved Hide resolved

body {
font-size: 14px;
}
Expand Down
19 changes: 8 additions & 11 deletions scripts/build-taro.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,19 @@ async function copyStyles() {
resolve(__dirname, '../dist/styles'),
)

const content = [
let content = [
`@import '../theme-default.scss';`,
`@import '../variables.scss';`,
`@import '../mixins/index.scss';`,
`@import '../animation/index.scss';`,
`@import '../theme-dark.scss';`,
`@import '../jd-font';`,
]
const projectID = process.env.VITE_APP_PROJECT_ID
if (projectID) {
content[1] = `@import '../variables-${projectID}.scss';`
content = [
`@import '../theme-${projectID}.scss';`,
oasis-cloud marked this conversation as resolved.
Show resolved Hide resolved
`@import '../jd-font';`,
]
}
const scssFiles = await glob(['dist/es/packages/**/*.scss'])
scssFiles.forEach((file) => {
content.push(
`@import '${relativeFilePath('/dist/styles/themes/default.scss', '/' + file)}';`,
)
})

dest('dist/styles/themes/default.scss', content.join('\n'))
}

Expand Down
19 changes: 8 additions & 11 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,19 @@ async function copyStyles() {
resolve(__dirname, '../dist/styles')
)

const content = [
let content = [
`@import '../theme-default.scss';`,
`@import '../variables.scss';`,
`@import '../mixins/index.scss';`,
`@import '../animation/index.scss';`,
`@import '../theme-dark.scss';`,
`@import '../jd-font';`,
]
const projectID = process.env.VITE_APP_PROJECT_ID
if (projectID) {
content[1] = `@import '../variables-${projectID}.scss';`
content = [
`@import '../theme-${projectID}.scss';`,
`@import '../jd-font';`,
]
}
const scssFiles = await glob(['dist/es/packages/**/*.scss'])
scssFiles.forEach((file) => {
content.push(
`@import '${relativeFilePath('/dist/styles/themes/default.scss', '/' + file)}';`
)
})

dest('dist/styles/themes/default.scss', content.join('\n'))
}

Expand Down
2 changes: 2 additions & 0 deletions src/sites/mobile/App.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../styles/jd-font.scss';

html,
body {
&::-webkit-scrollbar {
Expand Down
8 changes: 8 additions & 0 deletions src/styles/jd-font.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@font-face {
font-family: 'JD';
src: url('data:font/ttf;charset=utf-8;base64,AAEAAAAMAIAAAwBAR0RFRgATAA4AAAtkAAAAFk9TLzJvL3A9AAAGLAAAAGBjbWFwAF0AbwAABowAAAA8Z2FzcP//AAMAAAtcAAAACGdseWarNFnTAAAAzAAABJhoZWFkLNdRDQAABaQAAAA2aGhlYQ47BogAAAYIAAAAJGhtdHgX6gLYAAAF3AAAACpsb2NhCEsHiQAABYQAAAAebWF4cABaAEwAAAVkAAAAIG5hbWVqIjVqAAAGyAAABFFwb3N0/8AA2wAACxwAAAA+AAoAvv5mA0gGZgADAA4AEgAeACQALgA0AEAARABIAAABESEREyE1IzczNSEVMwc1ITUhNSE1IxUzNTMVIzUjNSE1IxUhNTM1MzUhFTMVIzUhNSM1IzUhNSM1MzUhFTMVIxM1MxUDNTMVA0j9dpgBVNGPQv6sj48BVP6sAVTNRkPMRAFURP7wzYf+rIeHAVSHzQFUh4f+roWHRMzMQwZm+AAIAPiOQ2FDQ2HT6Hvncy9gpC3Nhy+PRERMx0aPNURMQ0NM+wBgYAP4SUkAAAIAWP9CBLoGPwAXADUAAAEyHgMQDgMiLgM1ND4FARQSHgQyPgQSNTQCLg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AAAAAAH//wACAAEAAAAMAAAAAAAAAAIAAQADAA0AAQAA')
format('truetype');
font-weight: 400;
font-style: normal;
font-display: swap;
}
Loading