Skip to content

Commit

Permalink
fix(hydrate): ignore broken rule declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Aug 11, 2020
1 parent e58266a commit bc1ed78
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/otion/src/createInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ export function createInstance(): OtionInstance {
selectorText,
)!;
const property = style[0];
updatePrecedenceGroupRanges(
rulePrecedence(property, pseudoClass, !!isConditionalRule),
);
if (property) {
// Broken rule declarations are ignored
updatePrecedenceGroupRanges(
rulePrecedence(property, pseudoClass, !!isConditionalRule),
);
}
ruleIndexesByIdentName.set(identName, ruleIndexesByIdentName.size);
} else {
/* cssRule.type === CSSRule.MEDIA_RULE */
Expand Down

0 comments on commit bc1ed78

Please sign in to comment.