Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

本地和部署后的样式顺序不一样,导致样式有差异 #4

Closed
ldc4 opened this issue Mar 20, 2019 · 3 comments
Closed

本地和部署后的样式顺序不一样,导致样式有差异 #4

ldc4 opened this issue Mar 20, 2019 · 3 comments

Comments

@ldc4
Copy link
Owner

ldc4 commented Mar 20, 2019

gatsby issues搜了一圈,发现类似的问题,但是还是没有解决
gatsbyjs/gatsby#9733

@ldc4
Copy link
Owner Author

ldc4 commented May 1, 2019

是被typography.js的样式被覆盖了。
而且typography是通过插件注入到html的,也没有对应的配置项去改变。
导致没办法覆盖样式,除非每个样式都用important,这也太丑了。
但是,想要用它的主题样式,感觉只能妥协了。

@ldc4
Copy link
Owner Author

ldc4 commented May 4, 2019

gatsbyjs/gatsby#10324

@ldc4
Copy link
Owner Author

ldc4 commented May 4, 2019

临时解决方案:
由于覆盖,导致根节点的font-size为16px,而本地开发为14px
故把rem全部换算成px
另外,normalize默认的line-height为1.15,被覆盖为1.625
故在有line-height影响的节点,设置line-height样式为1.15

@ldc4 ldc4 closed this as completed May 4, 2019
ldc4 added a commit that referenced this issue May 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant