Created
July 26, 2022 19:05
-
-
Save jonesnxt/7564dfb72be312276cd7b2ca126a23ad to your computer and use it in GitHub Desktop.
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
styleSheets.map((sheet) => | |
Array.from(sheet.cssRules).map((rule) => | |
rule.type === rule.FONT_FACE_RULE | |
? { /* include this rule */ } | |
: rule.type === rule.STYLE_RULE | |
? { /* include this rule if above-the-fold */ } | |
: rule.type === rule.MEDIA_RULE | |
? Array.from(rule.cssRules) | |
.map((mediaRule) => | |
mediaRule.type === mediaRule.FONT_FACE_RULE | |
? { /* include this rule */ } | |
: mediaRule.type === mediaRule.STYLE_RULE | |
? { /* include this rule if above-the-fold */ } | |
: { /* don't include */ } | |
) | |
: { /* don't include */ } | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment