-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Feature: support importing css on demand even if we use the CSS variable version. #35259
Comments
Is it #34602 helpful? |
跟这个issue不太一样。 假如less-loader配的@root-entry-name是variable,理想的情况下,应该是不会引用 其他信息: |
css variable 版本不会再深入改造了,我们会迁移到 CSS in JS 方案上:#34087 |
感谢回复!dark主题或compact主题,也会迁移到CSS in JS方案上吗? |
会。 |
Reproduction link
https://github.com/TrickyPi/issue-repo
Steps to reproduce
What is expected?
支持动态导入组件的样式(支持使用babel-import-plugin),可以减少最后包的体积
What is actually happening?
官网的例子中,只有全局css文件引入,参考链接:https://ant.design/docs/react/customize-theme-variable#header
我在想,官网上没有提供按需引入的文档,是不是这个问题,如果是这个问题的话,
我觉得我们是否可以修改相关的gulp打包配置(.antd-tools.config.js),在打包es或lib目录时,处理一下
es/style/default.less
文件。出现第4个步骤的原因,是less-loader内配置的@root-entry-name影响不到
es/style/default.less
文件其后续导入的es/style/themes/index.less
文件内的动态引入@import './@{root-entry-name}.less
,这里的@root-entry-name
的值其实一直都是es/style/index.less
文件下@root-entry-name: default
设置的值(default
),相关引用顺序
es/style/default.less
->es/style/index.less
->es/style/index-pure.less
->es/style/themes/index.less
The text was updated successfully, but these errors were encountered: