@@ -47,7 +47,7 @@ class Rule {
47
47
constructor ( node : CssNode , stylesheet , parent ?: Atrule ) {
48
48
this . node = node ;
49
49
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 ) ) ;
51
51
this . declarations = node . block . children . map ( ( node : CssNode ) => new Declaration ( node ) ) ;
52
52
}
53
53
@@ -182,29 +182,29 @@ class Atrule {
182
182
183
183
minify ( code : MagicString , dev : boolean ) {
184
184
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 ] ;
186
186
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 ) ;
188
188
189
- this . node . expression . children . forEach ( ( query : CssNode ) => {
189
+ this . node . prelude . children . forEach ( ( query : CssNode ) => {
190
190
// TODO minify queries
191
191
c = query . end ;
192
192
} ) ;
193
193
194
194
code . remove ( c , this . node . block . start ) ;
195
195
} else if ( this . node . name === 'supports' ) {
196
196
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 ) => {
199
199
// TODO minify queries
200
200
c = query . end ;
201
201
} ) ;
202
202
code . remove ( c , this . node . block . start ) ;
203
203
} else {
204
204
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 ;
208
208
}
209
209
if ( this . node . block && this . node . block . start - c > 0 ) {
210
210
code . remove ( c , this . node . block . start ) ;
@@ -235,7 +235,7 @@ class Atrule {
235
235
236
236
transform ( code : MagicString , id : string , keyframes : Map < string , string > , max_amount_class_specificity_increased : number ) {
237
237
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 ) => {
239
239
if ( type === 'Identifier' ) {
240
240
if ( name . startsWith ( '-global-' ) ) {
241
241
code . remove ( start , start + 8 ) ;
@@ -317,7 +317,7 @@ export default class Stylesheet {
317
317
}
318
318
319
319
if ( is_keyframes_node ( node ) ) {
320
- node . expression . children . forEach ( ( expression : CssNode ) => {
320
+ node . prelude . children . forEach ( ( expression : CssNode ) => {
321
321
if ( expression . type === 'Identifier' && ! expression . name . startsWith ( '-global-' ) ) {
322
322
this . keyframes . set ( expression . name , `${ this . id } -${ expression . name } ` ) ;
323
323
}
0 commit comments