Skip to content

Commit

Permalink
updating to handle :is()
Browse files Browse the repository at this point in the history
  • Loading branch information
gieoon committed Feb 11, 2023
1 parent 431d3c7 commit d95c1e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function parseSelector(token) {
type: 'rule',
// fix css case: .my-class:not(.class1, .class2)
// Also case for: .wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center)
selectors: token.text.split(/(?<!:not\(.+?),/).map(trim),
selectors: token.text.split(/(?<!(:is|:not)\(.+?),/).filter(f => f).map(trim),
declarations: parseDeclarations(token)
});
}
Expand Down

1 comment on commit d95c1e6

@gieoon
Copy link
Author

@gieoon gieoon commented on d95c1e6 Feb 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This handles complex CSS that has :is(...) such as:

-o-transition:.3s all;transition:all .3s;will-change:margin-inline-start}.e-container>.e-container>.elementor-element-overlay>.elementor-editor-element-settings:hover>:is(.elementor-editor-element-duplicate,.elementor-editor-element-remove),.elementor-widget .e-container>.elementor-element-overlay>.elementor-editor-element-settings:hover>:is(.elementor-editor-element-duplicate,.elementor-editor-element-remove){-webkit-margin-start:0;margin-inline-start:0}

Please sign in to comment.