File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
packages/svelte/src/compiler Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ function read_rule(parser) {
118118 metadata : {
119119 parent_rule : null ,
120120 has_local_selectors : false ,
121- is_global : false ,
121+ has_global_selectors : false ,
122122 is_global_block : false
123123 }
124124 } ;
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ function is_global_block_selector(simple_selector) {
3636 */
3737function is_unscoped_global ( path ) {
3838 // remove every at rule or stylesheet and the current rule in case is passed in from `ComplexSelector`
39- return path . filter ( ( node ) => node . type === 'Rule' ) . every ( ( node ) => node . metadata . is_global ) ;
39+ return path
40+ . filter ( ( node ) => node . type === 'Rule' )
41+ . every ( ( node ) => node . metadata . has_global_selectors ) ;
4042}
4143
4244/**
@@ -263,7 +265,7 @@ const css_visitors = {
263265 // visit selector list first, to populate child selector metadata
264266 context . visit ( node . prelude , state ) ;
265267
266- node . metadata . is_global = node . prelude . children . some ( ( selector ) =>
268+ node . metadata . has_global_selectors = node . prelude . children . some ( ( selector ) =>
267269 selector . children . every ( ( { metadata } ) => metadata . is_global || metadata . is_global_like )
268270 ) ;
269271
@@ -275,7 +277,7 @@ const css_visitors = {
275277 // `:global(...)`, and the rule contains declarations (rather than just
276278 // nested rules) then the component as a whole includes global CSS
277279 context . state . has_global . value ||=
278- node . metadata . is_global &&
280+ node . metadata . has_global_selectors &&
279281 node . block . children . filter ( ( child ) => child . type === 'Declaration' ) . length > 0 &&
280282 is_unscoped_global ( context . path ) ;
281283
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export namespace _CSS {
3737 /**
3838 * `true` if the rule contains a ComplexSelector whose RelativeSelectors are all global or global-like
3939 */
40- is_global : boolean ;
40+ has_global_selectors : boolean ;
4141 /**
4242 * `true` if the rule contains a `:global` selector, and therefore everything inside should be unscoped
4343 */
You can’t perform that action at this time.
0 commit comments