@@ -47,7 +47,7 @@ class Rule {
4747 constructor ( node : CssNode , stylesheet , parent ?: Atrule ) {
4848 this . node = node ;
4949 this . parent = parent ;
50- this . selectors = node . selector . children . map ( ( node : CssNode ) => new Selector ( node , stylesheet ) ) ;
50+ this . selectors = node . prelude . children . map ( ( node : CssNode ) => new Selector ( node , stylesheet ) ) ;
5151 this . declarations = node . block . children . map ( ( node : CssNode ) => new Declaration ( node ) ) ;
5252 }
5353
@@ -182,29 +182,29 @@ class Atrule {
182182
183183 minify ( code : MagicString , dev : boolean ) {
184184 if ( this . node . name === 'media' ) {
185- const expression_char = code . original [ this . node . expression . start ] ;
185+ const expression_char = code . original [ this . node . prelude . start ] ;
186186 let c = this . node . start + ( expression_char === '(' ? 6 : 7 ) ;
187- if ( this . node . expression . start > c ) code . remove ( c , this . node . expression . start ) ;
187+ if ( this . node . prelude . start > c ) code . remove ( c , this . node . prelude . start ) ;
188188
189- this . node . expression . children . forEach ( ( query : CssNode ) => {
189+ this . node . prelude . children . forEach ( ( query : CssNode ) => {
190190 // TODO minify queries
191191 c = query . end ;
192192 } ) ;
193193
194194 code . remove ( c , this . node . block . start ) ;
195195 } else if ( this . node . name === 'supports' ) {
196196 let c = this . node . start + 9 ;
197- if ( this . node . expression . start - c > 1 ) code . overwrite ( c , this . node . expression . start , ' ' ) ;
198- this . node . expression . children . forEach ( ( query : CssNode ) => {
197+ if ( this . node . prelude . start - c > 1 ) code . overwrite ( c , this . node . prelude . start , ' ' ) ;
198+ this . node . prelude . children . forEach ( ( query : CssNode ) => {
199199 // TODO minify queries
200200 c = query . end ;
201201 } ) ;
202202 code . remove ( c , this . node . block . start ) ;
203203 } else {
204204 let c = this . node . start + this . node . name . length + 1 ;
205- if ( this . node . expression ) {
206- if ( this . node . expression . start - c > 1 ) code . overwrite ( c , this . node . expression . start , ' ' ) ;
207- c = this . node . expression . end ;
205+ if ( this . node . prelude ) {
206+ if ( this . node . prelude . start - c > 1 ) code . overwrite ( c , this . node . prelude . start , ' ' ) ;
207+ c = this . node . prelude . end ;
208208 }
209209 if ( this . node . block && this . node . block . start - c > 0 ) {
210210 code . remove ( c , this . node . block . start ) ;
@@ -235,7 +235,7 @@ class Atrule {
235235
236236 transform ( code : MagicString , id : string , keyframes : Map < string , string > , max_amount_class_specificity_increased : number ) {
237237 if ( is_keyframes_node ( this . node ) ) {
238- this . node . expression . children . forEach ( ( { type, name, start, end } : CssNode ) => {
238+ this . node . prelude . children . forEach ( ( { type, name, start, end } : CssNode ) => {
239239 if ( type === 'Identifier' ) {
240240 if ( name . startsWith ( '-global-' ) ) {
241241 code . remove ( start , start + 8 ) ;
@@ -317,7 +317,7 @@ export default class Stylesheet {
317317 }
318318
319319 if ( is_keyframes_node ( node ) ) {
320- node . expression . children . forEach ( ( expression : CssNode ) => {
320+ node . prelude . children . forEach ( ( expression : CssNode ) => {
321321 if ( expression . type === 'Identifier' && ! expression . name . startsWith ( '-global-' ) ) {
322322 this . keyframes . set ( expression . name , `${ this . id } -${ expression . name } ` ) ;
323323 }
0 commit comments