-
Notifications
You must be signed in to change notification settings - Fork 140
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
🐛 do not ignore @import rules pointing to inaccessible stylesheets #2398
🐛 do not ignore @import rules pointing to inaccessible stylesheets #2398
Conversation
/to-staging |
Codecov Report
@@ Coverage Diff @@
## main #2398 +/- ##
==========================================
+ Coverage 93.99% 94.01% +0.01%
==========================================
Files 212 212
Lines 6298 6299 +1
Branches 1405 1405
==========================================
+ Hits 5920 5922 +2
+ Misses 378 377 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
🚂 Branch Integration: starting soon, merge in < 7m commit 98431dde7e will soon be integrated into staging-35. This build is going to start soon! (estimated merge in less than 7m) you can cancel this operation by commenting your pull request with |
🚂 Branch Integration: this commit was successfully integrated Commit 98431dde7e has been merged into staging-35 in merge commit 2c2997766d. Check out the triggered pipeline on Gitlab 🦊 |
@@ -144,7 +144,7 @@ function getCssRulesString(cssStyleSheet: CSSStyleSheet | undefined | null): str | |||
} | |||
|
|||
function getCssRuleString(rule: CSSRule): string { | |||
return isCSSImportRule(rule) ? getCssRulesString(rule.styleSheet) || '' : rule.cssText | |||
return (isCSSImportRule(rule) && getCssRulesString(rule.styleSheet)) || rule.cssText |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 suggestion: a comment here could be helpful as well
Motivation
We follow @import rules and inline their content so the player can uses its strategy to emulate :hover states. But if the external stylesheet is inaccessible, we should still take the @import rule into account, so the external stylesheet can be loaded in the player.
Changes
If we fail to get the external stylesheet rule, use the
@import
rule cssText as a fallbackTesting
I have gone over the contributing documentation.