Skip to content

Commit

Permalink
Improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
m-akinc committed Apr 8, 2024
1 parent 1602548 commit 045efb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/preview/withPseudoState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ const applyParameter = (rootElement: Element, parameter: PseudoStateConfig = {})
// Shadow DOM can only access classes on its host. Traversing is needed to mimic the CSS cascade.
const updateShadowHost = (shadowHost: Element) => {
const classnames = new Set<string>()
// Keep any existing "pseudo-*" classes (but not "pseudo-*-all")
// Keep any existing "pseudo-*" classes (but not "pseudo-*-all").
// "pseudo-*-all" classes may be stale and will be re-added as needed.
shadowHost.className
.split(" ")
.filter((classname) => classname.match(/^pseudo-(.(?!-all))+$/))
Expand Down

0 comments on commit 045efb6

Please sign in to comment.