-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Generated css declares fonts multiple times (Roboto, NotoSans) #5931
Comments
@jimitndiaye Good Catch! Thanks for pointing this out! |
globals.mode is already imported in the components.mode file, so it doesn’t need to be imported per component fixes #5931
Thank you for finding this! It was caused by importing the global mode file in each component. I removed these imports from all of the components and confirmed it only includes the fonts once now. This will be fixed in the |
the user will need to include this import themselves if they include components individually fixes #5931
So since we want to be able to individually import components, the globals file needs to be imported in each component. I've reverted the previous commit and instead moved the font import up to the |
The latest change, while reducing the problem (down to 5 references to Roboto, for instance), did not eliminate it. Still my app.md.css has gone down to 946 KB unminified (down from over 7 MB) so my thanks for that. |
I am only seeing 4, one for each font-weight:
Are you seeing something different? |
Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/
Short description of the problem:
Generated app.md.css and app.wp.css (the only ones the reference external fonts, have the font declarations repeated 21 times each inflating the file size, especially if you want to embed some of the smaller font files as data-urls.
What behavior are you expecting?
Each font-face should be declared only once.
Steps to reproduce:
I believe the culprit is the use of
@at-root
in default.wp.scss and default.md.scss. I don't think node-sass (on which gulp-sass depends) understands it.I
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Which Ionic Version? 1.x or 2.x
2.x
Run
ionic info
from terminal/cmd prompt: (paste output below)The text was updated successfully, but these errors were encountered: