-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: assume non-class name selectors to be critical (#250)
For apps using a plugin such as MiniCssExtractPlugin and importing plain CSS files, the global CSS will often be in the same CSS file as the CSS extracted by Linaria. Previously, collect would place these styles in 'other', which would cause a FOUC. There's an undocumented 'globalCSS' argument, but it's not reasonable to manually specify it when you have already imported it in the app. This PR only checks class name based selectors to determine if they are critical and for all other styles, it will place them in the critical CSS. This handles global CSS without any manual work. This also removes the 'globalCSS' argument because it's not needed anymore.
- Loading branch information
Showing
4 changed files
with
25 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters