Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for multi-dimension critical css.
TLDR This is useful when you want to deliver multiple dimensions of critical css. Take for instance when your site has different elements visible at different resolutions. Prior to this work you were limited to multiple critical passes and inclusions or simply picking one resolution. Why is this better? I am glad you asked yourself that. Since we use clean-css we can intellegently merge the multiple resolution snapshots making for smaller and better multi snapshot rule generation. Why did I do this? While working on a website I noticed that we were getting a flash of styles after the normal stylesheet was loaded. This was not so bad on a computer screen (since that was the dimension that we targeted) however when on a phone it was quite a jarring experience.
- Loading branch information
Showing
4 changed files
with
165 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@media screen and (min-width: 900px) { | ||
div { | ||
height: 400px; | ||
background: brown; | ||
} | ||
} | ||
|
||
#revenge { | ||
background: papayawhip; | ||
} | ||
|
||
#of { | ||
background: teal; | ||
} | ||
|
||
#guybrush { | ||
color: pink; | ||
} | ||
|
||
#threepwood { | ||
background: 'orange'; | ||
content: 'monkey island'; | ||
} | ||
|
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