diff --git a/examples/rspack-react/package.json b/examples/rspack-react/package.json index 8343f06..f6ce935 100644 --- a/examples/rspack-react/package.json +++ b/examples/rspack-react/package.json @@ -13,10 +13,10 @@ "@rspack/cli": "^0.1.8" }, "dependencies": { + "@arco-design/theme-christmas": "^0.0.18", "@arco-design/web-react": "^2.47.1", "@arco-iconbox/react-partial-bits": "^0.0.3", "@arco-plugins/unplugin-react": "workspace:*", - "@arco-themes/react-asuka": "^0.0.1", "example-component-a": "workspace:*", "ky": "^0.33.3", "react": "^18.2.0", diff --git a/examples/rspack-react/rspack.config.js b/examples/rspack-react/rspack.config.js index 0a357ec..e9aa25c 100644 --- a/examples/rspack-react/rspack.config.js +++ b/examples/rspack-react/rspack.config.js @@ -49,7 +49,7 @@ module.exports = { }, plugins: [ new ArcoDesignPlugin({ - theme: '@arco-themes/react-asuka', + theme: path.resolve(__dirname, 'node_modules/@arco-design/theme-christmas'), iconBox: '@arco-iconbox/react-partial-bits', removeFontFace: true, defaultLanguage: 'ja-JP', diff --git a/examples/rspack-react/src/App.jsx b/examples/rspack-react/src/App.jsx index a55d8a2..eae41c7 100644 --- a/examples/rspack-react/src/App.jsx +++ b/examples/rspack-react/src/App.jsx @@ -22,7 +22,7 @@ function App() {
  1. -

    The color of button should be orange (theme: '@arco-themes/react-asuka'):

    +

    The button should be the Christmas style (theme: '@arco-design/theme-christmas'):

  2. diff --git a/packages/unplugin-react/src/plugins/theme.ts b/packages/unplugin-react/src/plugins/theme.ts index f4a7623..081d0e0 100644 --- a/packages/unplugin-react/src/plugins/theme.ts +++ b/packages/unplugin-react/src/plugins/theme.ts @@ -55,7 +55,7 @@ export class ThemePlugin { if (ext === '.css') { source = getFileSource(request); } else if (ext === '.less') { - source = `;\n@import '~${request}';`; + source = `;\n@import '~${this.options.theme}/tokens.less';\n@import '~${request}';`; } else { throw new Error('Only accept to match css or less files.'); } diff --git a/yarn.lock b/yarn.lock index ec2f226..417d1cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34,6 +34,15 @@ __metadata: languageName: node linkType: hard +"@arco-design/theme-christmas@npm:^0.0.18": + version: 0.0.18 + resolution: "@arco-design/theme-christmas@npm:0.0.18" + peerDependencies: + "@arco-design/web-react": ^2.26.0 + checksum: 4f4e4da648c1cee14bafc5e434dfa8d92b1a966dabbcd83090d80a3e4da4c4dfe219866257bbb3d493dccd49612d00b55bc0a39cee4e6ed9f53e02a2658d63a6 + languageName: node + linkType: hard + "@arco-design/web-react@npm:^2.35.1": version: 2.35.1 resolution: "@arco-design/web-react@npm:2.35.1" @@ -194,15 +203,6 @@ __metadata: languageName: unknown linkType: soft -"@arco-themes/react-asuka@npm:^0.0.1": - version: 0.0.1 - resolution: "@arco-themes/react-asuka@npm:0.0.1" - peerDependencies: - "@arco-design/web-react": ^2.47.1 - checksum: 051970e604273a997988bb9723d55df070b06ab19c605beaf98d91d25d9f632d575de9d6d06774d2570839d74665c7b5807802a6c43ae04e22e473251c725f51 - languageName: node - linkType: hard - "@arco-themes/react-plugin-test@npm:^0.0.1": version: 0.0.1 resolution: "@arco-themes/react-plugin-test@npm:0.0.1" @@ -7505,10 +7505,10 @@ __metadata: version: 0.0.0-use.local resolution: "example-rspack-react@workspace:examples/rspack-react" dependencies: + "@arco-design/theme-christmas": ^0.0.18 "@arco-design/web-react": ^2.47.1 "@arco-iconbox/react-partial-bits": ^0.0.3 "@arco-plugins/unplugin-react": "workspace:*" - "@arco-themes/react-asuka": ^0.0.1 "@rspack/cli": ^0.1.8 example-component-a: "workspace:*" ky: ^0.33.3