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

css in js 导致 px转换rem问题 #11

Closed
kongyijilafumi opened this issue Aug 3, 2023 · 5 comments
Closed

css in js 导致 px转换rem问题 #11

kongyijilafumi opened this issue Aug 3, 2023 · 5 comments
Labels

Comments

@kongyijilafumi
Copy link

我使用了postcss-pxtorem插件来去自动转换样式里面的px单位为rem。

  • 因为 css in js 缘故,所以在开发模式下,无法转换成rem单位。
    image
  • 在打包后,nuxt generate构建的页面放入生产环境,页面首次加载,css in js 好像没有加上样式。
    image
@aibayanyu20
Copy link
Member

可以先尝试自己创建一个tranform,px2rem
后面会同步到主库

@kongyijilafumi
Copy link
Author

使用nuxt generate预构建的页面,在首次加载页面会出现重绘,比如 button 组件从原始样式 css 过渡到 ui样式,css in js是不是在nuxt里有点不太符合 ssr性质,后续有办法能直接产生 css 文件吗?

@aibayanyu20
Copy link
Member

已经合并了等发版 antdv#6713

@aibayanyu20
Copy link
Member

已经发版了,参考demo

@jingjingshenye
Copy link

已经发版了,参考demo

demo里没有看到px2remTransformer啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants