File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,9 +74,7 @@ function printPseudoElements(data: VisualData) {
7474
7575 return `<style>@scope{:scope{\n${ Object . keys ( pseudoStyles )
7676 . sort ( )
77- . map ( ( name ) =>
78- indent ( `&${ name } {${ printProperties ( pseudoStyles [ name ] ) } }` )
79- )
77+ . map ( ( name ) => indent ( `&${ name } {${ printProperties ( pseudoStyles [ name ] ) } }` ) )
8078 . join ( "\n" ) } \n}}</style>`;
8179}
8280
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import splitSelectors from "./split-selector";
33import { SelectorWithStyles } from "./types" ;
44import { getDefaultStyles } from "./default-styles" ;
55const pseudoElementRegex =
6- / ( [ ( > ~ | + \s ] ) ? \s * : : ? ( b e f o r e | a f t e r | f i r s t - l e t t e r | f i r s t - l i n e | s e l e c t i o n | b a c k d r o p | p l a c e h o l d e r | m a r k e r | s p e l l i n g - e r r o r | g r a m m a r - e r r o r | t a r g e t (?: - t e x t ) ? ) / gi;
6+ / ( [ ( > ~ | + \s ] ) ? \s * : : ? ( b e f o r e | a f t e r | c h e c k m a r k | d e t a i l s - c o n t e n t | f i l e - s e l e c t o r - b u t t o n | f i r s t - l e t t e r | f i r s t - l i n e | s e l e c t i o n | b a c k d r o p | p l a c e h o l d e r (?: - s h o w n ) | p i c k e r - i c o n | m a r k e r | s p e l l i n g - e r r o r | g r a m m a r - e r r o r | t a r g e t - t e x t ) (? ! [ a - z - ] ) / gi;
77
88/**
99 * Given a document, reads all style sheets returns extracts all CSSRules
@@ -64,9 +64,13 @@ export function getPseudoElementStyles(
6464 seenPseudos = [ name ] ;
6565 }
6666
67- baseSelector =
68- baseSelector . slice ( 0 , match . index ) + ( childCombinator || "" ) ;
69- baseSelector . slice ( match . index + match [ 0 ] . length ) ;
67+ baseSelector = childCombinator
68+ ? baseSelector . slice ( 0 , match . index ) +
69+ childCombinator +
70+ "*" +
71+ baseSelector . slice ( match . index + match [ 0 ] . length )
72+ : baseSelector . slice ( 0 , match . index ) +
73+ baseSelector . slice ( match . index + match [ 0 ] . length ) ;
7074 }
7175
7276 if ( seenPseudos && el . matches ( baseSelector || "*" ) ) {
You can’t perform that action at this time.
0 commit comments