Skip to main content

oxc_css_parser/
ast.rs

1//! All kinds of AST nodes are here.
2
3use crate::{pos::Span, tokenizer::TokenWithSpan};
4use oxc_allocator::{Box, Vec};
5#[cfg(feature = "serialize")]
6use serde::Serialize;
7
8#[derive(Debug)]
9#[cfg_attr(feature = "serialize", derive(Serialize))]
10#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
11pub struct AnPlusB {
12    pub span: Span,
13    pub a: i32,
14    pub b: i32,
15}
16
17#[derive(Debug)]
18#[cfg_attr(feature = "serialize", derive(Serialize))]
19#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
20pub struct AtRule<'a> {
21    pub span: Span,
22    pub name: Ident<'a>,
23    pub prelude: Option<AtRulePrelude<'a>>,
24    pub block: Option<SimpleBlock<'a>>,
25}
26
27#[derive(Debug)]
28#[cfg_attr(feature = "serialize", derive(Serialize))]
29#[cfg_attr(feature = "serialize", serde(untagged))]
30pub enum AtRulePrelude<'a> {
31    Charset(Str<'a>),
32    ColorProfile(ColorProfilePrelude<'a>),
33    Container(ContainerPrelude<'a>),
34    CounterStyle(InterpolableIdent<'a>),
35    CustomMedia(Box<'a, CustomMedia<'a>>),
36    CustomSelector(Box<'a, CustomSelectorPrelude<'a>>),
37    Document(DocumentPrelude<'a>),
38    FontFeatureValues(FontFamilyName<'a>),
39    FontPaletteValues(InterpolableIdent<'a>),
40    Import(Box<'a, ImportPrelude<'a>>),
41    Keyframes(KeyframesName<'a>),
42    Layer(LayerNames<'a>),
43    LessImport(Box<'a, LessImportPrelude<'a>>),
44    LessPlugin(Box<'a, LessPlugin<'a>>),
45    Media(MediaQueryList<'a>),
46    Namespace(Box<'a, NamespacePrelude<'a>>),
47    Nest(SelectorList<'a>),
48    Page(PageSelectorList<'a>),
49    PositionTry(InterpolableIdent<'a>),
50    Property(InterpolableIdent<'a>),
51    SassAtRoot(SassAtRoot<'a>),
52    SassContent(SassContent<'a>),
53    SassEach(Box<'a, SassEach<'a>>),
54    SassExpr(Box<'a, ComponentValue<'a>>),
55    SassExtend(Box<'a, SassExtend<'a>>),
56    SassFor(Box<'a, SassFor<'a>>),
57    SassForward(Box<'a, SassForward<'a>>),
58    SassFunction(Box<'a, SassFunction<'a>>),
59    SassImport(SassImportPrelude<'a>),
60    SassInclude(Box<'a, SassInclude<'a>>),
61    SassMixin(Box<'a, SassMixin<'a>>),
62    SassUse(Box<'a, SassUse<'a>>),
63    Scope(Box<'a, ScopePrelude<'a>>),
64    ScrollTimeline(InterpolableIdent<'a>),
65    Supports(SupportsCondition<'a>),
66    Unknown(Box<'a, UnknownAtRulePrelude<'a>>),
67}
68
69#[derive(Debug)]
70#[cfg_attr(feature = "serialize", derive(Serialize))]
71#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
72pub struct AttributeSelector<'a> {
73    pub span: Span,
74    pub name: WqName<'a>,
75    pub matcher: Option<AttributeSelectorMatcher>,
76    pub value: Option<AttributeSelectorValue<'a>>,
77    pub modifier: Option<AttributeSelectorModifier<'a>>,
78}
79
80#[derive(Debug)]
81#[cfg_attr(feature = "serialize", derive(Serialize))]
82#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
83pub struct AttributeSelectorMatcher {
84    pub span: Span,
85    pub kind: AttributeSelectorMatcherKind,
86}
87
88#[derive(Debug)]
89#[cfg_attr(feature = "serialize", derive(Serialize))]
90pub enum AttributeSelectorMatcherKind {
91    /// `=`
92    Exact,
93    /// `~=`
94    MatchWord,
95    /// `|=`
96    ExactOrPrefixThenHyphen,
97    /// `^=`
98    Prefix,
99    /// `$=`
100    Suffix,
101    /// `*=`
102    Substring,
103}
104
105#[derive(Debug)]
106#[cfg_attr(feature = "serialize", derive(Serialize))]
107#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
108pub struct AttributeSelectorModifier<'a> {
109    pub span: Span,
110    pub ident: InterpolableIdent<'a>,
111}
112
113#[derive(Debug)]
114#[cfg_attr(feature = "serialize", derive(Serialize))]
115#[cfg_attr(feature = "serialize", serde(untagged))]
116pub enum AttributeSelectorValue<'a> {
117    Ident(InterpolableIdent<'a>),
118    Str(InterpolableStr<'a>),
119    Number(Number<'a>),
120    Dimension(Dimension<'a>),
121    Percentage(Percentage<'a>),
122    LessEscapedStr(LessEscapedStr<'a>),
123    TokenSeq(TokenSeq<'a>),
124}
125
126#[derive(Debug)]
127#[cfg_attr(feature = "serialize", derive(Serialize))]
128#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
129pub struct BracketBlock<'a> {
130    pub span: Span,
131    pub value: Vec<'a, ComponentValue<'a>>,
132}
133
134#[derive(Debug)]
135#[cfg_attr(feature = "serialize", derive(Serialize))]
136#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
137pub struct Calc<'a> {
138    pub span: Span,
139    pub left: Box<'a, ComponentValue<'a>>,
140    pub op: CalcOperator,
141    pub right: Box<'a, ComponentValue<'a>>,
142}
143
144#[derive(Debug)]
145#[cfg_attr(feature = "serialize", derive(Serialize))]
146#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
147pub struct CalcOperator {
148    pub span: Span,
149    pub kind: CalcOperatorKind,
150}
151
152#[derive(Debug)]
153#[cfg_attr(feature = "serialize", derive(Serialize))]
154pub enum CalcOperatorKind {
155    Plus,
156    Minus,
157    Multiply,
158    Division,
159    /// Sass modulo (`%`) inside a math function's arguments (`max(1px, 7px % 4)`).
160    Modulo,
161}
162
163#[derive(Debug)]
164#[cfg_attr(feature = "serialize", derive(Serialize))]
165#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
166pub struct ClassSelector<'a> {
167    pub span: Span,
168    pub name: InterpolableIdent<'a>,
169}
170
171#[derive(Debug)]
172#[cfg_attr(feature = "serialize", derive(Serialize))]
173#[cfg_attr(feature = "serialize", serde(untagged))]
174pub enum ColorProfilePrelude<'a> {
175    DashedIdent(InterpolableIdent<'a>),
176    DeviceCmyk(Ident<'a>),
177}
178
179#[derive(Debug)]
180#[cfg_attr(feature = "serialize", derive(Serialize))]
181#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
182pub struct Combinator {
183    pub span: Span,
184    pub kind: CombinatorKind,
185}
186
187#[derive(Debug, PartialEq, Eq)]
188#[cfg_attr(feature = "serialize", derive(Serialize))]
189pub enum CombinatorKind {
190    /// ` `
191    Descendant,
192    /// `+`
193    NextSibling,
194    /// `>`
195    Child,
196    /// `~`
197    LaterSibling,
198    /// `||`
199    Column,
200    /// `/deep/` (deprecated shadow-piercing descendant)
201    Deep,
202    /// `^` (deprecated shadow child)
203    ShadowChild,
204    /// `^^` (deprecated shadow descendant)
205    ShadowDescendant,
206}
207
208#[derive(Debug)]
209#[cfg_attr(feature = "serialize", derive(Serialize))]
210#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
211pub struct ComplexSelector<'a> {
212    pub span: Span,
213    pub children: Vec<'a, ComplexSelectorChild<'a>>,
214}
215
216#[derive(Debug)]
217#[cfg_attr(feature = "serialize", derive(Serialize))]
218#[cfg_attr(feature = "serialize", serde(untagged))]
219pub enum ComplexSelectorChild<'a> {
220    CompoundSelector(CompoundSelector<'a>),
221    Combinator(Combinator),
222}
223
224#[derive(Debug)]
225#[cfg_attr(feature = "serialize", derive(Serialize))]
226#[cfg_attr(feature = "serialize", serde(untagged))]
227pub enum ComponentValue<'a> {
228    BracketBlock(BracketBlock<'a>),
229    Calc(Calc<'a>),
230    Delimiter(Delimiter),
231    Dimension(Dimension<'a>),
232    Function(Function<'a>),
233    HexColor(HexColor<'a>),
234    IdSelector(IdSelector<'a>),
235    ImportantAnnotation(ImportantAnnotation<'a>),
236    InterpolableIdent(InterpolableIdent<'a>),
237    InterpolableStr(InterpolableStr<'a>),
238    LayerName(LayerName<'a>),
239    LessAnonymousMixin(LessAnonymousMixin<'a>),
240    LessBinaryOperation(LessBinaryOperation<'a>),
241    LessCondition(Box<'a, LessCondition<'a>>),
242    LessDetachedRuleset(LessDetachedRuleset<'a>),
243    LessEscapedStr(LessEscapedStr<'a>),
244    LessJavaScriptSnippet(LessJavaScriptSnippet<'a>),
245    LessList(LessList<'a>),
246    LessMixinCall(Box<'a, LessMixinCall<'a>>),
247    LessNamespaceValue(Box<'a, LessNamespaceValue<'a>>),
248    LessVariableCall(LessVariableCall<'a>),
249    LessNegativeValue(LessNegativeValue<'a>),
250    LessParenthesizedOperation(LessParenthesizedOperation<'a>),
251    LessPercentKeyword(LessPercentKeyword),
252    LessPropertyVariable(LessPropertyVariable<'a>),
253    LessVariable(LessVariable<'a>),
254    LessVariableVariable(LessVariableVariable<'a>),
255    Number(Number<'a>),
256    Percentage(Percentage<'a>),
257    Placeholder(Placeholder<'a>),
258    PostcssSimpleVar(PostcssSimpleVar<'a>),
259    Ratio(Ratio<'a>),
260    SassArbitraryArgument(SassArbitraryArgument<'a>),
261    SassBinaryExpression(SassBinaryExpression<'a>),
262    SassKeywordArgument(SassKeywordArgument<'a>),
263    SassList(SassList<'a>),
264    SassMap(SassMap<'a>),
265    SassQualifiedName(Box<'a, SassQualifiedName<'a>>),
266    SassNestingDeclaration(SassNestingDeclaration<'a>),
267    SassParenthesizedExpression(SassParenthesizedExpression<'a>),
268    SassParentSelector(NestingSelector<'a>),
269    SassUnaryExpression(SassUnaryExpression<'a>),
270    SassVariable(SassVariable<'a>),
271    TokenWithSpan(TokenWithSpan<'a>),
272    UnicodeRange(UnicodeRange<'a>),
273    Url(Box<'a, Url<'a>>),
274}
275
276#[derive(Debug)]
277#[cfg_attr(feature = "serialize", derive(Serialize))]
278#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
279pub struct ComponentValues<'a> {
280    pub span: Span,
281    pub values: Vec<'a, ComponentValue<'a>>,
282}
283
284#[derive(Debug)]
285#[cfg_attr(feature = "serialize", derive(Serialize))]
286#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
287pub struct CompoundSelector<'a> {
288    pub span: Span,
289    pub children: Vec<'a, SimpleSelector<'a>>,
290}
291
292#[derive(Debug)]
293#[cfg_attr(feature = "serialize", derive(Serialize))]
294#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
295pub struct CompoundSelectorList<'a> {
296    pub span: Span,
297    pub selectors: Vec<'a, CompoundSelector<'a>>,
298    pub comma_spans: Vec<'a, Span>,
299}
300
301#[derive(Debug)]
302#[cfg_attr(feature = "serialize", derive(Serialize))]
303#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
304pub struct ContainerCondition<'a> {
305    pub span: Span,
306    pub conditions: Vec<'a, ContainerConditionKind<'a>>,
307}
308
309#[derive(Debug)]
310#[cfg_attr(feature = "serialize", derive(Serialize))]
311#[cfg_attr(feature = "serialize", serde(untagged))]
312pub enum ContainerConditionKind<'a> {
313    QueryInParens(QueryInParens<'a>),
314    And(ContainerConditionAnd<'a>),
315    Or(ContainerConditionOr<'a>),
316    Not(ContainerConditionNot<'a>),
317}
318
319#[derive(Debug)]
320#[cfg_attr(feature = "serialize", derive(Serialize))]
321#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
322pub struct ContainerConditionAnd<'a> {
323    pub span: Span,
324    pub keyword: Ident<'a>,
325    pub query_in_parens: QueryInParens<'a>,
326}
327
328#[derive(Debug)]
329#[cfg_attr(feature = "serialize", derive(Serialize))]
330#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
331pub struct ContainerConditionNot<'a> {
332    pub span: Span,
333    pub keyword: Ident<'a>,
334    pub query_in_parens: QueryInParens<'a>,
335}
336
337#[derive(Debug)]
338#[cfg_attr(feature = "serialize", derive(Serialize))]
339#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
340pub struct ContainerConditionOr<'a> {
341    pub span: Span,
342    pub keyword: Ident<'a>,
343    pub query_in_parens: QueryInParens<'a>,
344}
345
346#[derive(Debug)]
347#[cfg_attr(feature = "serialize", derive(Serialize))]
348#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
349pub struct ContainerPrelude<'a> {
350    pub span: Span,
351    pub name: Option<InterpolableIdent<'a>>,
352    pub condition: Option<ContainerCondition<'a>>,
353}
354
355#[derive(Debug)]
356#[cfg_attr(feature = "serialize", derive(Serialize))]
357#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
358pub struct CustomMedia<'a> {
359    pub span: Span,
360    pub name: InterpolableIdent<'a>,
361    pub value: CustomMediaValue<'a>,
362}
363
364#[derive(Debug)]
365#[cfg_attr(feature = "serialize", derive(Serialize))]
366#[cfg_attr(feature = "serialize", serde(untagged))]
367pub enum CustomMediaValue<'a> {
368    MediaQueryList(MediaQueryList<'a>),
369    True(Ident<'a>),
370    False(Ident<'a>),
371}
372
373#[derive(Debug)]
374#[cfg_attr(feature = "serialize", derive(Serialize))]
375#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
376pub struct CustomSelector<'a> {
377    pub span: Span,
378    pub prefix_arg: Option<CustomSelectorArg<'a>>,
379    pub name: Ident<'a>,
380    pub args: Option<CustomSelectorArgs<'a>>,
381}
382
383#[derive(Debug)]
384#[cfg_attr(feature = "serialize", derive(Serialize))]
385#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
386pub struct CustomSelectorArg<'a> {
387    pub span: Span,
388    pub name: Ident<'a>,
389}
390
391#[derive(Debug)]
392#[cfg_attr(feature = "serialize", derive(Serialize))]
393#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
394pub struct CustomSelectorArgs<'a> {
395    pub span: Span,
396    pub args: Vec<'a, CustomSelectorArg<'a>>,
397    pub comma_spans: Vec<'a, Span>,
398}
399
400#[derive(Debug)]
401#[cfg_attr(feature = "serialize", derive(Serialize))]
402#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
403pub struct CustomSelectorPrelude<'a> {
404    pub span: Span,
405    pub custom_selector: CustomSelector<'a>,
406    pub selector: SelectorList<'a>,
407}
408
409#[derive(Debug)]
410#[cfg_attr(feature = "serialize", derive(Serialize))]
411#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
412pub struct Declaration<'a> {
413    pub span: Span,
414    pub name: InterpolableIdent<'a>,
415    /// Scss / Less only: the IE `*` hack prefix (`*color: red`).
416    /// In Css the sigil is part of the postcss property name (README "Acceptance").
417    #[cfg_attr(feature = "serialize", serde(skip_serializing_if = "Option::is_none"))]
418    pub name_prefix: Option<char>,
419    pub name_suffix: Option<char>,
420    pub colon_span: Span,
421    pub value: Vec<'a, ComponentValue<'a>>,
422    /// The typed `<declaration-value>` grammar did not read all of `value`,
423    /// so it is the raw token run: a custom property or `progid:` filter
424    /// (any syntax; Scss reads a custom property as text like dart-sass),
425    /// or Css's `<any-value>` fallback for a normal property.
426    pub value_is_raw: bool,
427    pub important: Option<ImportantAnnotation<'a>>,
428    pub less_property_merge: Option<LessPropertyMerge>,
429}
430
431#[derive(Debug)]
432#[cfg_attr(feature = "serialize", derive(Serialize))]
433#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
434pub struct Delimiter {
435    pub span: Span,
436    pub kind: DelimiterKind,
437}
438
439#[derive(Debug)]
440#[cfg_attr(feature = "serialize", derive(Serialize))]
441pub enum DelimiterKind {
442    Comma,
443    Solidus,
444    Semicolon,
445}
446
447#[derive(Debug)]
448#[cfg_attr(feature = "serialize", derive(Serialize))]
449#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
450pub struct Dimension<'a> {
451    pub span: Span,
452    pub value: Number<'a>,
453    pub unit: Ident<'a>,
454    pub kind: DimensionKind,
455}
456
457#[derive(Debug)]
458#[cfg_attr(feature = "serialize", derive(Serialize))]
459pub enum DimensionKind {
460    Length,
461    Angle,
462    Duration,
463    Frequency,
464    Resolution,
465    Flex,
466    Unknown,
467}
468
469#[derive(Debug)]
470#[cfg_attr(feature = "serialize", derive(Serialize))]
471#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
472pub struct DocumentPrelude<'a> {
473    pub span: Span,
474    pub matchers: Vec<'a, DocumentPreludeMatcher<'a>>,
475    pub comma_spans: Vec<'a, Span>,
476}
477
478#[derive(Debug)]
479#[cfg_attr(feature = "serialize", derive(Serialize))]
480#[cfg_attr(feature = "serialize", serde(untagged))]
481pub enum DocumentPreludeMatcher<'a> {
482    Url(Url<'a>),
483    Function(Function<'a>),
484}
485
486#[derive(Debug)]
487#[cfg_attr(feature = "serialize", derive(Serialize))]
488#[cfg_attr(feature = "serialize", serde(untagged))]
489pub enum FontFamilyName<'a> {
490    Str(InterpolableStr<'a>),
491    Unquoted(UnquotedFontFamilyName<'a>),
492}
493
494#[derive(Debug)]
495#[cfg_attr(feature = "serialize", derive(Serialize))]
496#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
497pub struct Function<'a> {
498    pub span: Span,
499    pub name: FunctionName<'a>,
500    pub args: Vec<'a, ComponentValue<'a>>,
501}
502
503#[derive(Debug)]
504#[cfg_attr(feature = "serialize", derive(Serialize))]
505#[cfg_attr(feature = "serialize", serde(untagged))]
506pub enum FunctionName<'a> {
507    Ident(InterpolableIdent<'a>),
508    SassQualifiedName(Box<'a, SassQualifiedName<'a>>),
509    LessListFunction(LessListFunction),
510    LessFormatFunction(LessFormatFunction),
511}
512
513#[derive(Debug)]
514#[cfg_attr(feature = "serialize", derive(Serialize))]
515#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
516pub struct HexColor<'a> {
517    pub span: Span,
518    pub value: &'a str,
519    pub raw: &'a str,
520}
521
522#[derive(Debug)]
523#[cfg_attr(feature = "serialize", derive(Serialize))]
524#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
525pub struct Ident<'a> {
526    pub span: Span,
527    pub name: &'a str,
528    pub raw: &'a str,
529}
530
531#[derive(Debug)]
532#[cfg_attr(feature = "serialize", derive(Serialize))]
533#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
534pub struct ImportPrelude<'a> {
535    pub span: Span,
536    pub href: ImportPreludeHref<'a>,
537    pub layer: Option<ImportPreludeLayer<'a>>,
538    pub supports: Option<ImportPreludeSupports<'a>>,
539    pub media: Option<MediaQueryList<'a>>,
540    /// Import modifiers that don't fit the `layer()`/`supports()`/media-query
541    /// grammar, kept as raw component values — reference compilers accept an
542    /// arbitrary mix of idents, functions, and parens here, and a comma may
543    /// even chain further imports (`@import "a" b c(d), "e" supports(f: g);`).
544    /// When present, `layer`/`supports`/`media` are `None` and the whole
545    /// post-URL tail lives here.
546    pub modifiers: Option<ComponentValues<'a>>,
547}
548
549#[derive(Debug)]
550#[cfg_attr(feature = "serialize", derive(Serialize))]
551#[cfg_attr(feature = "serialize", serde(untagged))]
552pub enum ImportPreludeHref<'a> {
553    Str(InterpolableStr<'a>),
554    Url(Url<'a>),
555    /// Sass only: `url(...)` whose content is not a parsable URL but is
556    /// valid SassScript, e.g. `@import url($dir+"/path");`.
557    Function(Function<'a>),
558}
559
560#[derive(Debug)]
561#[cfg_attr(feature = "serialize", derive(Serialize))]
562#[cfg_attr(feature = "serialize", serde(untagged))]
563pub enum ImportPreludeLayer<'a> {
564    Empty(Ident<'a>),
565    WithName(Function<'a>),
566}
567
568#[derive(Debug)]
569#[cfg_attr(feature = "serialize", derive(Serialize))]
570#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
571pub struct ImportPreludeSupports<'a> {
572    pub span: Span,
573    pub kind: ImportPreludeSupportsKind<'a>,
574}
575
576#[derive(Debug)]
577#[cfg_attr(feature = "serialize", derive(Serialize))]
578#[cfg_attr(feature = "serialize", serde(untagged))]
579pub enum ImportPreludeSupportsKind<'a> {
580    SupportsCondition(SupportsCondition<'a>),
581    Declaration(Declaration<'a>),
582}
583
584#[derive(Debug)]
585#[cfg_attr(feature = "serialize", derive(Serialize))]
586#[cfg_attr(feature = "serialize", serde(untagged))]
587pub enum InterpolableIdent<'a> {
588    Literal(Ident<'a>),
589    SassInterpolated(SassInterpolatedIdent<'a>),
590    LessInterpolated(LessInterpolatedIdent<'a>),
591    Placeholder(Placeholder<'a>),
592}
593
594impl InterpolableIdent<'_> {
595    /// A custom-property name: the decoded name starts with `--`.
596    /// Sass interpolation may follow that static prefix (`--#{$name}`),
597    /// which is how dart-sass classifies it too.
598    pub fn is_custom_property(&self) -> bool {
599        match self {
600            Self::Literal(ident) => ident.name.starts_with("--"),
601            Self::SassInterpolated(ident) => matches!(
602                ident.elements.first(),
603                Some(SassInterpolatedIdentElement::Static(part)) if part.value.starts_with("--")
604            ),
605            Self::LessInterpolated(_) | Self::Placeholder(_) => false,
606        }
607    }
608}
609
610/// An atomic backtick-delimited template placeholder node (see
611/// [`ParserOptions::template_placeholder`](crate::config::ParserOptions)),
612/// carrying the parsed decimal index. Appears in value, selector, and
613/// statement positions where a downstream formatter substitutes interpolations.
614#[derive(Debug)]
615#[cfg_attr(feature = "serialize", derive(Serialize))]
616#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
617pub struct Placeholder<'a> {
618    pub span: Span,
619    pub index: u32,
620    /// An ident-continuation run glued directly after the placeholder
621    /// (`` `PLACEHOLDER-0`px `` -> index 0, suffix `"px"`), empty when none.
622    /// Mirrors `#{$x}px` being a single identifier rather than two tokens.
623    pub suffix: &'a str,
624}
625
626#[derive(Debug)]
627#[cfg_attr(feature = "serialize", derive(Serialize))]
628#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
629pub struct InterpolableIdentStaticPart<'a> {
630    pub span: Span,
631    pub value: &'a str,
632    pub raw: &'a str,
633}
634
635#[derive(Debug)]
636#[cfg_attr(feature = "serialize", derive(Serialize))]
637#[cfg_attr(feature = "serialize", serde(untagged))]
638pub enum InterpolableStr<'a> {
639    Literal(Str<'a>),
640    SassInterpolated(SassInterpolatedStr<'a>),
641    LessInterpolated(LessInterpolatedStr<'a>),
642}
643
644#[derive(Debug)]
645#[cfg_attr(feature = "serialize", derive(Serialize))]
646#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
647pub struct InterpolableStrStaticPart<'a> {
648    pub span: Span,
649    pub value: &'a str,
650    pub raw: &'a str,
651}
652
653#[derive(Debug)]
654#[cfg_attr(feature = "serialize", derive(Serialize))]
655#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
656pub struct InterpolableUrlStaticPart<'a> {
657    pub span: Span,
658    pub value: &'a str,
659    pub raw: &'a str,
660}
661
662#[derive(Debug)]
663#[cfg_attr(feature = "serialize", derive(Serialize))]
664#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
665pub struct IdSelector<'a> {
666    pub span: Span,
667    pub name: InterpolableIdent<'a>,
668}
669
670#[derive(Debug)]
671#[cfg_attr(feature = "serialize", derive(Serialize))]
672#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
673pub struct ImportantAnnotation<'a> {
674    pub span: Span,
675    pub ident: Ident<'a>,
676}
677
678#[derive(Debug)]
679#[cfg_attr(feature = "serialize", derive(Serialize))]
680#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
681pub struct KeyframeBlock<'a> {
682    pub span: Span,
683    pub selectors: Vec<'a, KeyframeSelector<'a>>,
684    pub comma_spans: Vec<'a, Span>,
685    pub block: SimpleBlock<'a>,
686}
687
688#[derive(Debug)]
689#[cfg_attr(feature = "serialize", derive(Serialize))]
690#[cfg_attr(feature = "serialize", serde(untagged))]
691pub enum KeyframeSelector<'a> {
692    Ident(InterpolableIdent<'a>),
693    Percentage(Percentage<'a>),
694    TimelineRange(KeyframeTimelineRange<'a>),
695}
696
697/// A scroll-driven animations keyframe selector: `<timeline-range-name>
698/// <percentage>` (`entry 0%`, `exit-crossing 100%`).
699#[derive(Debug)]
700#[cfg_attr(feature = "serialize", derive(Serialize))]
701#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
702pub struct KeyframeTimelineRange<'a> {
703    pub span: Span,
704    pub name: InterpolableIdent<'a>,
705    pub percentage: Percentage<'a>,
706}
707
708#[derive(Debug)]
709#[cfg_attr(feature = "serialize", derive(Serialize))]
710#[cfg_attr(feature = "serialize", serde(untagged))]
711pub enum KeyframesName<'a> {
712    Ident(InterpolableIdent<'a>),
713    Str(InterpolableStr<'a>),
714    LessVariable(LessVariable<'a>),
715    LessEscapedStr(LessEscapedStr<'a>),
716}
717
718#[derive(Debug)]
719#[cfg_attr(feature = "serialize", derive(Serialize))]
720#[cfg_attr(feature = "serialize", serde(untagged))]
721pub enum LanguageRange<'a> {
722    Str(InterpolableStr<'a>),
723    Ident(InterpolableIdent<'a>),
724}
725
726#[derive(Debug)]
727#[cfg_attr(feature = "serialize", derive(Serialize))]
728#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
729pub struct LanguageRangeList<'a> {
730    pub span: Span,
731    pub ranges: Vec<'a, LanguageRange<'a>>,
732    pub comma_spans: Vec<'a, Span>,
733}
734
735#[derive(Debug)]
736#[cfg_attr(feature = "serialize", derive(Serialize))]
737#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
738pub struct LayerName<'a> {
739    pub span: Span,
740    pub idents: Vec<'a, InterpolableIdent<'a>>,
741}
742
743#[derive(Debug)]
744#[cfg_attr(feature = "serialize", derive(Serialize))]
745#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
746pub struct LayerNames<'a> {
747    pub span: Span,
748    pub names: Vec<'a, LayerName<'a>>,
749    pub comma_spans: Vec<'a, Span>,
750}
751
752#[derive(Debug)]
753#[cfg_attr(feature = "serialize", derive(Serialize))]
754#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
755pub struct LessBinaryCondition<'a> {
756    pub span: Span,
757    pub left: Box<'a, LessCondition<'a>>,
758    pub op: LessBinaryConditionOperator,
759    pub right: Box<'a, LessCondition<'a>>,
760}
761
762#[derive(Debug)]
763#[cfg_attr(feature = "serialize", derive(Serialize))]
764#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
765pub struct LessBinaryConditionOperator {
766    pub span: Span,
767    pub kind: LessBinaryConditionOperatorKind,
768}
769
770#[derive(Debug)]
771#[cfg_attr(feature = "serialize", derive(Serialize))]
772pub enum LessBinaryConditionOperatorKind {
773    GreaterThan,
774    GreaterThanOrEqual,
775    LessThan,
776    LessThanOrEqual,
777    Equal,
778    EqualOrGreaterThan,
779    EqualOrLessThan,
780    And,
781    Or,
782}
783
784#[derive(Debug)]
785#[cfg_attr(feature = "serialize", derive(Serialize))]
786#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
787pub struct LessAnonymousMixin<'a> {
788    pub span: Span,
789    pub params: LessMixinParameters<'a>,
790    pub block: SimpleBlock<'a>,
791}
792
793#[derive(Debug)]
794#[cfg_attr(feature = "serialize", derive(Serialize))]
795#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
796pub struct LessBinaryOperation<'a> {
797    pub span: Span,
798    pub left: Box<'a, ComponentValue<'a>>,
799    pub op: LessOperationOperator,
800    pub right: Box<'a, ComponentValue<'a>>,
801}
802
803#[derive(Debug)]
804#[cfg_attr(feature = "serialize", derive(Serialize))]
805#[cfg_attr(feature = "serialize", serde(untagged))]
806pub enum LessCondition<'a> {
807    Binary(LessBinaryCondition<'a>),
808    Negated(LessNegatedCondition<'a>),
809    Parenthesized(LessParenthesizedCondition<'a>),
810    Value(ComponentValue<'a>),
811}
812
813#[derive(Debug)]
814#[cfg_attr(feature = "serialize", derive(Serialize))]
815#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
816pub struct LessConditionalQualifiedRule<'a> {
817    pub span: Span,
818    pub selector: SelectorList<'a>,
819    pub guard: LessConditions<'a>,
820    pub block: SimpleBlock<'a>,
821}
822
823#[derive(Debug)]
824#[cfg_attr(feature = "serialize", derive(Serialize))]
825#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
826pub struct LessConditions<'a> {
827    pub span: Span,
828    pub conditions: Vec<'a, LessCondition<'a>>,
829    pub when_span: Span,
830    pub comma_spans: Vec<'a, Span>,
831}
832
833#[derive(Debug)]
834#[cfg_attr(feature = "serialize", derive(Serialize))]
835#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
836pub struct LessDetachedRuleset<'a> {
837    pub span: Span,
838    pub block: SimpleBlock<'a>,
839}
840
841#[derive(Debug)]
842#[cfg_attr(feature = "serialize", derive(Serialize))]
843#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
844pub struct LessEscapedStr<'a> {
845    pub span: Span,
846    pub str: Str<'a>,
847}
848
849#[derive(Debug)]
850#[cfg_attr(feature = "serialize", derive(Serialize))]
851#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
852pub struct LessExtend<'a> {
853    pub span: Span,
854    pub selector: ComplexSelector<'a>,
855    pub all: Option<Ident<'a>>,
856}
857
858#[derive(Debug)]
859#[cfg_attr(feature = "serialize", derive(Serialize))]
860#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
861pub struct LessExtendList<'a> {
862    pub span: Span,
863    pub elements: Vec<'a, LessExtend<'a>>,
864    pub comma_spans: Vec<'a, Span>,
865}
866
867#[derive(Debug)]
868#[cfg_attr(feature = "serialize", derive(Serialize))]
869#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
870pub struct LessExtendRule<'a> {
871    pub span: Span,
872    pub nesting_selector: NestingSelector<'a>,
873    pub name_of_extend: Ident<'a>,
874    pub extend: LessExtendList<'a>,
875}
876
877#[derive(Debug)]
878#[cfg_attr(feature = "serialize", derive(Serialize))]
879#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
880pub struct LessFormatFunction {
881    pub span: Span,
882}
883
884#[derive(Debug)]
885#[cfg_attr(feature = "serialize", derive(Serialize))]
886#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
887pub struct LessImportOptions<'a> {
888    pub span: Span,
889    pub names: Vec<'a, Ident<'a>>,
890    pub comma_spans: Vec<'a, Span>,
891}
892
893#[derive(Debug)]
894#[cfg_attr(feature = "serialize", derive(Serialize))]
895#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
896pub struct LessImportPrelude<'a> {
897    pub span: Span,
898    pub href: ImportPreludeHref<'a>,
899    pub options: LessImportOptions<'a>,
900    pub media: Option<MediaQueryList<'a>>,
901}
902
903#[derive(Debug)]
904#[cfg_attr(feature = "serialize", derive(Serialize))]
905#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
906pub struct LessInterpolatedIdent<'a> {
907    pub span: Span,
908    pub elements: Vec<'a, LessInterpolatedIdentElement<'a>>,
909}
910
911#[derive(Debug)]
912#[cfg_attr(feature = "serialize", derive(Serialize))]
913#[cfg_attr(feature = "serialize", serde(untagged))]
914pub enum LessInterpolatedIdentElement<'a> {
915    Variable(LessVariableInterpolation<'a>),
916    Property(LessPropertyInterpolation<'a>),
917    Static(InterpolableIdentStaticPart<'a>),
918}
919
920#[derive(Debug)]
921#[cfg_attr(feature = "serialize", derive(Serialize))]
922#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
923pub struct LessInterpolatedStr<'a> {
924    pub span: Span,
925    pub elements: Vec<'a, LessInterpolatedStrElement<'a>>,
926}
927
928#[derive(Debug)]
929#[cfg_attr(feature = "serialize", derive(Serialize))]
930#[cfg_attr(feature = "serialize", serde(untagged))]
931pub enum LessInterpolatedStrElement<'a> {
932    Variable(LessVariableInterpolation<'a>),
933    Property(LessPropertyInterpolation<'a>),
934    Static(InterpolableStrStaticPart<'a>),
935}
936
937#[derive(Debug)]
938#[cfg_attr(feature = "serialize", derive(Serialize))]
939#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
940pub struct LessJavaScriptSnippet<'a> {
941    pub span: Span,
942    pub code: &'a str,
943    pub raw: &'a str,
944    pub escaped: bool,
945}
946
947#[derive(Debug)]
948#[cfg_attr(feature = "serialize", derive(Serialize))]
949#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
950pub struct LessList<'a> {
951    pub span: Span,
952    pub elements: Vec<'a, ComponentValue<'a>>,
953    pub comma_spans: Option<Vec<'a, Span>>,
954}
955
956#[derive(Debug)]
957#[cfg_attr(feature = "serialize", derive(Serialize))]
958#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
959pub struct LessListFunction {
960    pub span: Span,
961}
962
963#[derive(Debug)]
964#[cfg_attr(feature = "serialize", derive(Serialize))]
965#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
966pub struct LessLookup<'a> {
967    pub span: Span,
968    pub name: Option<LessLookupName<'a>>,
969}
970
971#[derive(Debug)]
972#[cfg_attr(feature = "serialize", derive(Serialize))]
973#[cfg_attr(feature = "serialize", serde(untagged))]
974pub enum LessLookupName<'a> {
975    LessVariable(LessVariable<'a>),
976    LessVariableVariable(LessVariableVariable<'a>),
977    LessPropertyVariable(LessPropertyVariable<'a>),
978    LessPropertyInterpolation(LessPropertyInterpolation<'a>),
979    Ident(Ident<'a>),
980}
981
982#[derive(Debug)]
983#[cfg_attr(feature = "serialize", derive(Serialize))]
984#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
985pub struct LessLookups<'a> {
986    pub span: Span,
987    pub lookups: Vec<'a, LessLookup<'a>>,
988}
989
990#[derive(Debug)]
991#[cfg_attr(feature = "serialize", derive(Serialize))]
992#[cfg_attr(feature = "serialize", serde(untagged))]
993pub enum LessMixinArgument<'a> {
994    Named(LessMixinNamedArgument<'a>),
995    Value(ComponentValue<'a>),
996    Variadic(LessMixinVariadicArgument<'a>),
997}
998
999#[derive(Debug)]
1000#[cfg_attr(feature = "serialize", derive(Serialize))]
1001#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1002pub struct LessMixinArguments<'a> {
1003    pub span: Span,
1004    pub args: Vec<'a, LessMixinArgument<'a>>,
1005    pub is_comma_separated: bool,
1006    pub separator_spans: Vec<'a, Span>,
1007}
1008
1009#[derive(Debug)]
1010#[cfg_attr(feature = "serialize", derive(Serialize))]
1011#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1012pub struct LessMixinCall<'a> {
1013    pub span: Span,
1014    pub callee: LessMixinCallee<'a>,
1015    pub args: Option<LessMixinArguments<'a>>,
1016    pub important: Option<ImportantAnnotation<'a>>,
1017}
1018
1019#[derive(Debug)]
1020#[cfg_attr(feature = "serialize", derive(Serialize))]
1021#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1022pub struct LessMixinCallee<'a> {
1023    pub span: Span,
1024    pub children: Vec<'a, LessMixinCalleeChild<'a>>,
1025}
1026
1027#[derive(Debug)]
1028#[cfg_attr(feature = "serialize", derive(Serialize))]
1029#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1030pub struct LessMixinCalleeChild<'a> {
1031    pub span: Span,
1032    pub name: LessMixinName<'a>,
1033    pub combinator: Option<Combinator>,
1034}
1035
1036#[derive(Debug)]
1037#[cfg_attr(feature = "serialize", derive(Serialize))]
1038#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1039pub struct LessMixinDefinition<'a> {
1040    pub span: Span,
1041    pub name: LessMixinName<'a>,
1042    pub params: LessMixinParameters<'a>,
1043    pub guard: Option<LessConditions<'a>>,
1044    pub block: SimpleBlock<'a>,
1045}
1046
1047#[derive(Debug)]
1048#[cfg_attr(feature = "serialize", derive(Serialize))]
1049#[cfg_attr(feature = "serialize", serde(untagged))]
1050pub enum LessMixinName<'a> {
1051    ClassSelector(ClassSelector<'a>),
1052    IdSelector(IdSelector<'a>),
1053}
1054
1055#[derive(Debug)]
1056#[cfg_attr(feature = "serialize", derive(Serialize))]
1057#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1058pub struct LessMixinNamedArgument<'a> {
1059    pub span: Span,
1060    pub name: LessMixinParameterName<'a>,
1061    pub colon_span: Span,
1062    pub value: ComponentValue<'a>,
1063}
1064
1065#[derive(Debug)]
1066#[cfg_attr(feature = "serialize", derive(Serialize))]
1067#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1068pub struct LessMixinNamedParameter<'a> {
1069    pub span: Span,
1070    pub name: LessMixinParameterName<'a>,
1071    pub value: Option<LessMixinNamedParameterDefaultValue<'a>>,
1072}
1073
1074#[derive(Debug)]
1075#[cfg_attr(feature = "serialize", derive(Serialize))]
1076#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1077pub struct LessMixinNamedParameterDefaultValue<'a> {
1078    pub span: Span,
1079    pub colon_span: Span,
1080    pub value: ComponentValue<'a>,
1081}
1082
1083#[derive(Debug)]
1084#[cfg_attr(feature = "serialize", derive(Serialize))]
1085#[cfg_attr(feature = "serialize", serde(untagged))]
1086pub enum LessMixinParameter<'a> {
1087    Named(LessMixinNamedParameter<'a>),
1088    Unnamed(LessMixinUnnamedParameter<'a>),
1089    Variadic(LessMixinVariadicParameter<'a>),
1090}
1091
1092#[derive(Debug)]
1093#[cfg_attr(feature = "serialize", derive(Serialize))]
1094#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1095pub struct LessMixinParameters<'a> {
1096    pub span: Span,
1097    pub params: Vec<'a, LessMixinParameter<'a>>,
1098    pub is_comma_separated: bool,
1099    pub separator_spans: Vec<'a, Span>,
1100}
1101
1102#[derive(Debug)]
1103#[cfg_attr(feature = "serialize", derive(Serialize))]
1104#[cfg_attr(feature = "serialize", serde(untagged))]
1105pub enum LessMixinParameterName<'a> {
1106    Variable(LessVariable<'a>),
1107    PropertyVariable(LessPropertyVariable<'a>),
1108}
1109
1110#[derive(Debug)]
1111#[cfg_attr(feature = "serialize", derive(Serialize))]
1112#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1113pub struct LessMixinUnnamedParameter<'a> {
1114    pub span: Span,
1115    pub value: ComponentValue<'a>,
1116}
1117
1118#[derive(Debug)]
1119#[cfg_attr(feature = "serialize", derive(Serialize))]
1120#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1121pub struct LessMixinVariadicArgument<'a> {
1122    pub span: Span,
1123    pub name: LessMixinParameterName<'a>,
1124}
1125
1126#[derive(Debug)]
1127#[cfg_attr(feature = "serialize", derive(Serialize))]
1128#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1129pub struct LessMixinVariadicParameter<'a> {
1130    pub span: Span,
1131    pub name: Option<LessMixinParameterName<'a>>,
1132}
1133
1134#[derive(Debug)]
1135#[cfg_attr(feature = "serialize", derive(Serialize))]
1136#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1137pub struct LessNamespaceValue<'a> {
1138    pub span: Span,
1139    pub callee: LessNamespaceValueCallee<'a>,
1140    pub lookups: LessLookups<'a>,
1141}
1142
1143#[derive(Debug)]
1144#[cfg_attr(feature = "serialize", derive(Serialize))]
1145#[cfg_attr(feature = "serialize", serde(untagged))]
1146pub enum LessNamespaceValueCallee<'a> {
1147    LessMixinCall(LessMixinCall<'a>),
1148    LessVariable(LessVariable<'a>),
1149}
1150
1151#[derive(Debug)]
1152#[cfg_attr(feature = "serialize", derive(Serialize))]
1153#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1154pub struct LessNegatedCondition<'a> {
1155    pub span: Span,
1156    pub condition: Box<'a, LessCondition<'a>>,
1157}
1158
1159#[derive(Debug)]
1160#[cfg_attr(feature = "serialize", derive(Serialize))]
1161#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1162pub struct LessNegativeValue<'a> {
1163    pub span: Span,
1164    pub value: Box<'a, ComponentValue<'a>>,
1165}
1166
1167#[derive(Debug)]
1168#[cfg_attr(feature = "serialize", derive(Serialize))]
1169#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1170pub struct LessOperationOperator {
1171    pub span: Span,
1172    pub kind: LessOperationOperatorKind,
1173}
1174
1175#[derive(Debug)]
1176#[cfg_attr(feature = "serialize", derive(Serialize))]
1177pub enum LessOperationOperatorKind {
1178    Multiply,
1179    Division,
1180    Plus,
1181    Minus,
1182}
1183
1184#[derive(Debug)]
1185#[cfg_attr(feature = "serialize", derive(Serialize))]
1186#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1187pub struct LessParenthesizedCondition<'a> {
1188    pub span: Span,
1189    pub condition: Box<'a, LessCondition<'a>>,
1190}
1191
1192#[derive(Debug)]
1193#[cfg_attr(feature = "serialize", derive(Serialize))]
1194#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1195pub struct LessParenthesizedOperation<'a> {
1196    pub span: Span,
1197    pub operation: Box<'a, ComponentValue<'a>>,
1198}
1199
1200#[derive(Debug)]
1201#[cfg_attr(feature = "serialize", derive(Serialize))]
1202#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1203pub struct LessPercentKeyword {
1204    pub span: Span,
1205}
1206
1207#[derive(Debug)]
1208#[cfg_attr(feature = "serialize", derive(Serialize))]
1209#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1210pub struct LessPlugin<'a> {
1211    pub span: Span,
1212    pub path: LessPluginPath<'a>,
1213    pub args: Option<TokenSeq<'a>>,
1214}
1215
1216#[derive(Debug)]
1217#[cfg_attr(feature = "serialize", derive(Serialize))]
1218#[cfg_attr(feature = "serialize", serde(untagged))]
1219pub enum LessPluginPath<'a> {
1220    Str(Str<'a>),
1221    Url(Url<'a>),
1222}
1223
1224#[derive(Debug)]
1225#[cfg_attr(feature = "serialize", derive(Serialize))]
1226#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1227pub struct LessPropertyInterpolation<'a> {
1228    pub span: Span,
1229    pub name: Ident<'a>,
1230}
1231
1232#[derive(Debug)]
1233#[cfg_attr(feature = "serialize", derive(Serialize))]
1234#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1235pub struct LessPropertyMerge {
1236    pub span: Span,
1237    pub kind: LessPropertyMergeKind,
1238}
1239
1240#[derive(Debug)]
1241#[cfg_attr(feature = "serialize", derive(Serialize))]
1242pub enum LessPropertyMergeKind {
1243    Comma,
1244    Space,
1245}
1246
1247#[derive(Debug)]
1248#[cfg_attr(feature = "serialize", derive(Serialize))]
1249#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1250pub struct LessPropertyVariable<'a> {
1251    pub span: Span,
1252    pub name: Ident<'a>,
1253}
1254
1255#[derive(Debug)]
1256#[cfg_attr(feature = "serialize", derive(Serialize))]
1257#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1258pub struct LessVariable<'a> {
1259    pub span: Span,
1260    pub name: Ident<'a>,
1261}
1262
1263#[derive(Debug)]
1264#[cfg_attr(feature = "serialize", derive(Serialize))]
1265#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1266pub struct LessVariableCall<'a> {
1267    pub span: Span,
1268    pub variable: LessVariable<'a>,
1269}
1270
1271#[derive(Debug)]
1272#[cfg_attr(feature = "serialize", derive(Serialize))]
1273#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1274pub struct LessVariableDeclaration<'a> {
1275    pub span: Span,
1276    pub name: LessVariable<'a>,
1277    pub colon_span: Span,
1278    pub value: ComponentValue<'a>,
1279}
1280
1281#[derive(Debug)]
1282#[cfg_attr(feature = "serialize", derive(Serialize))]
1283#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1284pub struct LessVariableInterpolation<'a> {
1285    pub span: Span,
1286    pub name: Ident<'a>,
1287}
1288
1289#[derive(Debug)]
1290#[cfg_attr(feature = "serialize", derive(Serialize))]
1291#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1292pub struct LessVariableVariable<'a> {
1293    pub span: Span,
1294    pub variable: LessVariable<'a>,
1295}
1296
1297#[derive(Debug)]
1298#[cfg_attr(feature = "serialize", derive(Serialize))]
1299#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1300pub struct MediaAnd<'a> {
1301    pub span: Span,
1302    pub keyword: Ident<'a>,
1303    pub media_in_parens: MediaInParens<'a>,
1304}
1305
1306#[derive(Debug)]
1307#[cfg_attr(feature = "serialize", derive(Serialize))]
1308#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1309pub struct MediaCondition<'a> {
1310    pub span: Span,
1311    pub conditions: Vec<'a, MediaConditionKind<'a>>,
1312}
1313
1314#[derive(Debug)]
1315#[cfg_attr(feature = "serialize", derive(Serialize))]
1316#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1317pub struct MediaConditionAfterMediaType<'a> {
1318    pub span: Span,
1319    pub and: Ident<'a>,
1320    pub condition: MediaCondition<'a>,
1321}
1322
1323#[derive(Debug)]
1324#[cfg_attr(feature = "serialize", derive(Serialize))]
1325#[cfg_attr(feature = "serialize", serde(untagged))]
1326pub enum MediaConditionKind<'a> {
1327    MediaInParens(MediaInParens<'a>),
1328    And(MediaAnd<'a>),
1329    Or(MediaOr<'a>),
1330    Not(MediaNot<'a>),
1331}
1332
1333#[derive(Debug)]
1334#[cfg_attr(feature = "serialize", derive(Serialize))]
1335#[cfg_attr(feature = "serialize", serde(untagged))]
1336pub enum MediaFeature<'a> {
1337    Plain(Box<'a, MediaFeaturePlain<'a>>),
1338    Boolean(MediaFeatureBoolean<'a>),
1339    Range(Box<'a, MediaFeatureRange<'a>>),
1340    RangeInterval(Box<'a, MediaFeatureRangeInterval<'a>>),
1341}
1342
1343#[derive(Debug)]
1344#[cfg_attr(feature = "serialize", derive(Serialize))]
1345#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1346pub struct MediaFeatureComparison {
1347    pub span: Span,
1348    pub kind: MediaFeatureComparisonKind,
1349}
1350
1351#[derive(Debug)]
1352#[cfg_attr(feature = "serialize", derive(Serialize))]
1353pub enum MediaFeatureComparisonKind {
1354    LessThan,
1355    LessThanOrEqual,
1356    GreaterThan,
1357    GreaterThanOrEqual,
1358    Equal,
1359}
1360
1361#[derive(Debug)]
1362#[cfg_attr(feature = "serialize", derive(Serialize))]
1363#[cfg_attr(feature = "serialize", serde(untagged))]
1364pub enum MediaFeatureName<'a> {
1365    Ident(InterpolableIdent<'a>),
1366    PostcssSimpleVar(PostcssSimpleVar<'a>),
1367    SassVariable(SassVariable<'a>),
1368}
1369
1370#[derive(Debug)]
1371#[cfg_attr(feature = "serialize", derive(Serialize))]
1372#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1373pub struct MediaFeatureBoolean<'a> {
1374    pub span: Span,
1375    pub name: MediaFeatureName<'a>,
1376}
1377
1378#[derive(Debug)]
1379#[cfg_attr(feature = "serialize", derive(Serialize))]
1380#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1381pub struct MediaFeaturePlain<'a> {
1382    pub span: Span,
1383    pub name: MediaFeatureName<'a>,
1384    pub colon_span: Span,
1385    pub value: ComponentValue<'a>,
1386}
1387
1388#[derive(Debug)]
1389#[cfg_attr(feature = "serialize", derive(Serialize))]
1390#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1391pub struct MediaFeatureRange<'a> {
1392    pub span: Span,
1393    pub left: ComponentValue<'a>,
1394    pub comparison: MediaFeatureComparison,
1395    pub right: ComponentValue<'a>,
1396}
1397
1398#[derive(Debug)]
1399#[cfg_attr(feature = "serialize", derive(Serialize))]
1400#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1401pub struct MediaFeatureRangeInterval<'a> {
1402    pub span: Span,
1403    pub left: ComponentValue<'a>,
1404    pub left_comparison: MediaFeatureComparison,
1405    pub name: MediaFeatureName<'a>,
1406    pub right_comparison: MediaFeatureComparison,
1407    pub right: ComponentValue<'a>,
1408}
1409
1410#[derive(Debug)]
1411#[cfg_attr(feature = "serialize", derive(Serialize))]
1412#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1413pub struct MediaInParens<'a> {
1414    pub span: Span,
1415    pub kind: MediaInParensKind<'a>,
1416}
1417
1418#[derive(Debug)]
1419#[cfg_attr(feature = "serialize", derive(Serialize))]
1420#[cfg_attr(feature = "serialize", serde(untagged))]
1421pub enum MediaInParensKind<'a> {
1422    MediaCondition(MediaCondition<'a>),
1423    MediaFeature(Box<'a, MediaFeature<'a>>),
1424    GeneralEnclosed(TokenSeq<'a>),
1425    SassInterpolation(SassInterpolatedIdent<'a>),
1426}
1427
1428#[derive(Debug)]
1429#[cfg_attr(feature = "serialize", derive(Serialize))]
1430#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1431pub struct MediaNot<'a> {
1432    pub span: Span,
1433    pub keyword: Ident<'a>,
1434    pub media_in_parens: MediaInParens<'a>,
1435}
1436
1437#[derive(Debug)]
1438#[cfg_attr(feature = "serialize", derive(Serialize))]
1439#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1440pub struct MediaOr<'a> {
1441    pub span: Span,
1442    pub keyword: Ident<'a>,
1443    pub media_in_parens: MediaInParens<'a>,
1444}
1445
1446#[derive(Debug)]
1447#[cfg_attr(feature = "serialize", derive(Serialize))]
1448#[cfg_attr(feature = "serialize", serde(untagged))]
1449pub enum MediaQuery<'a> {
1450    ConditionOnly(MediaCondition<'a>),
1451    WithType(Box<'a, MediaQueryWithType<'a>>),
1452    Function(Function<'a>),
1453    LessVariable(LessVariable<'a>),
1454    LessNamespaceValue(Box<'a, LessNamespaceValue<'a>>),
1455}
1456
1457#[derive(Debug)]
1458#[cfg_attr(feature = "serialize", derive(Serialize))]
1459#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1460pub struct MediaQueryList<'a> {
1461    pub span: Span,
1462    pub queries: Vec<'a, MediaQuery<'a>>,
1463    pub comma_spans: Vec<'a, Span>,
1464}
1465
1466#[derive(Debug)]
1467#[cfg_attr(feature = "serialize", derive(Serialize))]
1468#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1469pub struct MediaQueryWithType<'a> {
1470    pub span: Span,
1471    pub modifier: Option<Ident<'a>>,
1472    pub media_type: InterpolableIdent<'a>,
1473    pub condition: Option<MediaConditionAfterMediaType<'a>>,
1474}
1475
1476#[derive(Debug)]
1477#[cfg_attr(feature = "serialize", derive(Serialize))]
1478#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1479pub struct NamespacePrelude<'a> {
1480    pub span: Span,
1481    pub prefix: Option<InterpolableIdent<'a>>,
1482    pub uri: NamespacePreludeUri<'a>,
1483}
1484
1485#[derive(Debug)]
1486#[cfg_attr(feature = "serialize", derive(Serialize))]
1487#[cfg_attr(feature = "serialize", serde(untagged))]
1488pub enum NamespacePreludeUri<'a> {
1489    Str(InterpolableStr<'a>),
1490    Url(Url<'a>),
1491}
1492
1493#[derive(Debug)]
1494#[cfg_attr(feature = "serialize", derive(Serialize))]
1495#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1496pub struct NestingSelector<'a> {
1497    pub span: Span,
1498    pub suffix: Option<InterpolableIdent<'a>>,
1499}
1500
1501#[derive(Debug)]
1502#[cfg_attr(feature = "serialize", derive(Serialize))]
1503#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1504pub struct NsPrefix<'a> {
1505    pub span: Span,
1506    pub kind: Option<NsPrefixKind<'a>>,
1507}
1508
1509#[derive(Debug)]
1510#[cfg_attr(feature = "serialize", derive(Serialize))]
1511#[cfg_attr(feature = "serialize", serde(untagged))]
1512pub enum NsPrefixKind<'a> {
1513    Ident(InterpolableIdent<'a>),
1514    Universal(NsPrefixUniversal),
1515}
1516
1517#[derive(Debug)]
1518#[cfg_attr(feature = "serialize", derive(Serialize))]
1519#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1520pub struct NsPrefixUniversal {
1521    pub span: Span,
1522}
1523
1524#[derive(Debug)]
1525#[cfg_attr(feature = "serialize", derive(Serialize))]
1526#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1527pub struct Nth<'a> {
1528    pub span: Span,
1529    pub index: NthIndex<'a>,
1530    pub matcher: Option<NthMatcher<'a>>,
1531}
1532
1533#[derive(Debug)]
1534#[cfg_attr(feature = "serialize", derive(Serialize))]
1535#[cfg_attr(feature = "serialize", serde(untagged))]
1536pub enum NthIndex<'a> {
1537    Odd(Ident<'a>),
1538    Even(Ident<'a>),
1539    Integer(Number<'a>),
1540    AnPlusB(AnPlusB),
1541}
1542
1543#[derive(Debug)]
1544#[cfg_attr(feature = "serialize", derive(Serialize))]
1545#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1546pub struct NthMatcher<'a> {
1547    pub span: Span,
1548    pub selector: Option<SelectorList<'a>>,
1549}
1550
1551#[derive(Debug)]
1552#[cfg_attr(feature = "serialize", derive(Serialize))]
1553#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1554pub struct Number<'a> {
1555    pub span: Span,
1556    pub value: f32,
1557    pub raw: &'a str,
1558}
1559
1560#[derive(Debug)]
1561#[cfg_attr(feature = "serialize", derive(Serialize))]
1562#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1563pub struct PageSelector<'a> {
1564    pub span: Span,
1565    pub name: Option<InterpolableIdent<'a>>,
1566    pub pseudo: Vec<'a, PseudoPage<'a>>,
1567}
1568
1569#[derive(Debug)]
1570#[cfg_attr(feature = "serialize", derive(Serialize))]
1571#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1572pub struct PageSelectorList<'a> {
1573    pub span: Span,
1574    pub selectors: Vec<'a, PageSelector<'a>>,
1575    pub comma_spans: Vec<'a, Span>,
1576}
1577
1578#[derive(Debug)]
1579#[cfg_attr(feature = "serialize", derive(Serialize))]
1580#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1581pub struct Percentage<'a> {
1582    pub span: Span,
1583    pub value: Number<'a>,
1584}
1585
1586#[derive(Debug)]
1587#[cfg_attr(feature = "serialize", derive(Serialize))]
1588#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1589pub struct PostcssSimpleVar<'a> {
1590    pub span: Span,
1591    pub name: Ident<'a>,
1592}
1593
1594#[derive(Debug)]
1595#[cfg_attr(feature = "serialize", derive(Serialize))]
1596#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1597pub struct PostcssSimpleVarDeclaration<'a> {
1598    pub span: Span,
1599    pub name: PostcssSimpleVar<'a>,
1600    pub colon_span: Span,
1601    pub value: Vec<'a, ComponentValue<'a>>,
1602    /// The typed `<declaration-value>` grammar did not read all of `value`,
1603    /// so it is the raw token run used by postcss-simple-vars for textual substitution.
1604    pub value_is_raw: bool,
1605}
1606
1607#[derive(Debug)]
1608#[cfg_attr(feature = "serialize", derive(Serialize))]
1609#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1610pub struct PseudoClassSelector<'a> {
1611    pub span: Span,
1612    pub name: InterpolableIdent<'a>,
1613    pub arg: Option<PseudoClassSelectorArg<'a>>,
1614}
1615
1616#[derive(Debug)]
1617#[cfg_attr(feature = "serialize", derive(Serialize))]
1618#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1619pub struct PseudoClassSelectorArg<'a> {
1620    pub span: Span,
1621    pub kind: PseudoClassSelectorArgKind<'a>,
1622    pub l_paren: Span,
1623    pub r_paren: Span,
1624}
1625
1626#[derive(Debug)]
1627#[cfg_attr(feature = "serialize", derive(Serialize))]
1628#[cfg_attr(feature = "serialize", serde(untagged))]
1629pub enum PseudoClassSelectorArgKind<'a> {
1630    CompoundSelectorList(CompoundSelectorList<'a>),
1631    Ident(InterpolableIdent<'a>),
1632    LanguageRangeList(LanguageRangeList<'a>),
1633    Nth(Nth<'a>),
1634    Number(Number<'a>),
1635    RelativeSelectorList(RelativeSelectorList<'a>),
1636    SelectorList(SelectorList<'a>),
1637    LessExtendList(LessExtendList<'a>),
1638    TokenSeq(TokenSeq<'a>),
1639}
1640
1641#[derive(Debug)]
1642#[cfg_attr(feature = "serialize", derive(Serialize))]
1643#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1644pub struct PseudoElementSelector<'a> {
1645    pub span: Span,
1646    pub name: InterpolableIdent<'a>,
1647    pub arg: Option<PseudoElementSelectorArg<'a>>,
1648}
1649
1650#[derive(Debug)]
1651#[cfg_attr(feature = "serialize", derive(Serialize))]
1652#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1653pub struct PseudoElementSelectorArg<'a> {
1654    pub span: Span,
1655    pub kind: PseudoElementSelectorArgKind<'a>,
1656    pub l_paren: Span,
1657    pub r_paren: Span,
1658}
1659
1660#[derive(Debug)]
1661#[cfg_attr(feature = "serialize", derive(Serialize))]
1662#[cfg_attr(feature = "serialize", serde(untagged))]
1663pub enum PseudoElementSelectorArgKind<'a> {
1664    CompoundSelector(CompoundSelector<'a>),
1665    CompoundSelectorList(CompoundSelectorList<'a>),
1666    Ident(InterpolableIdent<'a>),
1667    IdentList(IdentList<'a>),
1668    TokenSeq(TokenSeq<'a>),
1669}
1670
1671/// A space-separated `<ident>+` list, e.g. the argument of `::part(tab active)`
1672/// (CSS Shadow Parts).
1673#[derive(Debug)]
1674#[cfg_attr(feature = "serialize", derive(Serialize))]
1675#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1676pub struct IdentList<'a> {
1677    pub span: Span,
1678    pub idents: Vec<'a, InterpolableIdent<'a>>,
1679}
1680
1681#[derive(Debug)]
1682#[cfg_attr(feature = "serialize", derive(Serialize))]
1683#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1684pub struct PseudoPage<'a> {
1685    pub span: Span,
1686    pub name: InterpolableIdent<'a>,
1687    /// The raw argument of a functional pseudo-page, e.g. `g` in
1688    /// `@page::slot(g)` (CSS Template Layout).
1689    pub arg: Option<TokenSeq<'a>>,
1690}
1691
1692#[derive(Debug)]
1693#[cfg_attr(feature = "serialize", derive(Serialize))]
1694#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1695pub struct QualifiedRule<'a> {
1696    pub span: Span,
1697    pub selector: SelectorList<'a>,
1698    pub block: SimpleBlock<'a>,
1699}
1700
1701#[derive(Debug)]
1702#[cfg_attr(feature = "serialize", derive(Serialize))]
1703#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1704pub struct QueryInParens<'a> {
1705    pub span: Span,
1706    pub kind: QueryInParensKind<'a>,
1707}
1708
1709#[derive(Debug)]
1710#[cfg_attr(feature = "serialize", derive(Serialize))]
1711#[cfg_attr(feature = "serialize", serde(untagged))]
1712pub enum QueryInParensKind<'a> {
1713    ContainerCondition(ContainerCondition<'a>),
1714    SizeFeature(Box<'a, MediaFeature<'a>>),
1715    StyleQuery(StyleQuery<'a>),
1716    ScrollState(Box<'a, MediaFeature<'a>>),
1717    GeneralEnclosed(TokenSeq<'a>),
1718}
1719
1720#[derive(Debug)]
1721#[cfg_attr(feature = "serialize", derive(Serialize))]
1722#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1723pub struct Ratio<'a> {
1724    pub span: Span,
1725    pub numerator: Number<'a>,
1726    pub solidus_span: Span,
1727    pub denominator: Number<'a>,
1728}
1729
1730#[derive(Debug)]
1731#[cfg_attr(feature = "serialize", derive(Serialize))]
1732#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1733pub struct RelativeSelector<'a> {
1734    pub span: Span,
1735    pub combinator: Option<Combinator>,
1736    pub complex_selector: ComplexSelector<'a>,
1737}
1738
1739#[derive(Debug)]
1740#[cfg_attr(feature = "serialize", derive(Serialize))]
1741#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1742pub struct RelativeSelectorList<'a> {
1743    pub span: Span,
1744    pub selectors: Vec<'a, RelativeSelector<'a>>,
1745    pub comma_spans: Vec<'a, Span>,
1746}
1747
1748#[derive(Debug)]
1749#[cfg_attr(feature = "serialize", derive(Serialize))]
1750#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1751pub struct SassArbitraryArgument<'a> {
1752    pub span: Span,
1753    pub value: Box<'a, ComponentValue<'a>>,
1754}
1755
1756#[derive(Debug)]
1757#[cfg_attr(feature = "serialize", derive(Serialize))]
1758#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1759pub struct SassArbitraryParameter<'a> {
1760    pub span: Span,
1761    pub name: SassVariable<'a>,
1762}
1763
1764#[derive(Debug)]
1765#[cfg_attr(feature = "serialize", derive(Serialize))]
1766#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1767pub struct SassAtRoot<'a> {
1768    pub span: Span,
1769    pub kind: SassAtRootKind<'a>,
1770}
1771
1772#[derive(Debug)]
1773#[cfg_attr(feature = "serialize", derive(Serialize))]
1774#[cfg_attr(feature = "serialize", serde(untagged))]
1775pub enum SassAtRootKind<'a> {
1776    Selector(SelectorList<'a>),
1777    Query(SassAtRootQuery<'a>),
1778}
1779
1780#[derive(Debug)]
1781#[cfg_attr(feature = "serialize", derive(Serialize))]
1782#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1783pub struct SassAtRootQuery<'a> {
1784    pub span: Span,
1785    pub modifier: SassAtRootQueryModifier,
1786    pub colon_span: Span,
1787    /// space-separated rule names
1788    pub rules: Vec<'a, SassAtRootQueryRule<'a>>,
1789}
1790
1791#[derive(Debug)]
1792#[cfg_attr(feature = "serialize", derive(Serialize))]
1793#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1794pub struct SassAtRootQueryModifier {
1795    pub span: Span,
1796    pub kind: SassAtRootQueryModifierKind,
1797}
1798
1799#[derive(Debug)]
1800#[cfg_attr(feature = "serialize", derive(Serialize))]
1801pub enum SassAtRootQueryModifierKind {
1802    With,
1803    Without,
1804}
1805
1806#[derive(Debug)]
1807#[cfg_attr(feature = "serialize", derive(Serialize))]
1808#[cfg_attr(feature = "serialize", serde(untagged))]
1809pub enum SassAtRootQueryRule<'a> {
1810    Ident(InterpolableIdent<'a>),
1811    Str(InterpolableStr<'a>),
1812}
1813
1814#[derive(Debug)]
1815#[cfg_attr(feature = "serialize", derive(Serialize))]
1816#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1817pub struct SassBinaryExpression<'a> {
1818    pub span: Span,
1819    pub left: Box<'a, ComponentValue<'a>>,
1820    pub op: SassBinaryOperator,
1821    pub right: Box<'a, ComponentValue<'a>>,
1822}
1823
1824#[derive(Debug)]
1825#[cfg_attr(feature = "serialize", derive(Serialize))]
1826#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1827pub struct SassBinaryOperator {
1828    pub span: Span,
1829    pub kind: SassBinaryOperatorKind,
1830}
1831
1832#[derive(Debug)]
1833#[cfg_attr(feature = "serialize", derive(Serialize))]
1834pub enum SassBinaryOperatorKind {
1835    Multiply,
1836    Division,
1837    Modulo,
1838    Plus,
1839    Minus,
1840    GreaterThan,
1841    GreaterThanOrEqual,
1842    LessThan,
1843    LessThanOrEqual,
1844    EqualsEquals,
1845    ExclamationEquals,
1846    And,
1847    Or,
1848}
1849
1850#[derive(Debug)]
1851#[cfg_attr(feature = "serialize", derive(Serialize))]
1852#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1853pub struct SassConditionalClause<'a> {
1854    pub span: Span,
1855    pub condition: ComponentValue<'a>,
1856    pub block: SimpleBlock<'a>,
1857}
1858
1859#[derive(Debug)]
1860#[cfg_attr(feature = "serialize", derive(Serialize))]
1861#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1862pub struct SassContent<'a> {
1863    pub span: Span,
1864    pub args: Vec<'a, ComponentValue<'a>>,
1865    pub comma_spans: Vec<'a, Span>,
1866}
1867
1868#[derive(Debug)]
1869#[cfg_attr(feature = "serialize", derive(Serialize))]
1870#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1871pub struct SassEach<'a> {
1872    pub span: Span,
1873    pub bindings: Vec<'a, SassVariable<'a>>,
1874    pub comma_spans: Vec<'a, Span>,
1875    pub in_span: Span,
1876    pub expr: ComponentValue<'a>,
1877}
1878
1879#[derive(Debug)]
1880#[cfg_attr(feature = "serialize", derive(Serialize))]
1881#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1882pub struct SassExtend<'a> {
1883    pub span: Span,
1884    pub selectors: CompoundSelectorList<'a>,
1885    pub optional: Option<SassFlag<'a>>,
1886}
1887
1888#[derive(Debug)]
1889#[cfg_attr(feature = "serialize", derive(Serialize))]
1890#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1891pub struct SassFlag<'a> {
1892    pub span: Span,
1893    pub keyword: Ident<'a>,
1894}
1895
1896#[derive(Debug)]
1897#[cfg_attr(feature = "serialize", derive(Serialize))]
1898#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1899pub struct SassFor<'a> {
1900    pub span: Span,
1901    pub binding: SassVariable<'a>,
1902    pub from_span: Span,
1903    pub start: ComponentValue<'a>,
1904    pub end: ComponentValue<'a>,
1905    pub boundary: SassForBoundary,
1906}
1907
1908#[derive(Debug)]
1909#[cfg_attr(feature = "serialize", derive(Serialize))]
1910#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1911pub struct SassForBoundary {
1912    pub span: Span,
1913    pub kind: SassForBoundaryKind,
1914}
1915
1916#[derive(Debug)]
1917#[cfg_attr(feature = "serialize", derive(Serialize))]
1918pub enum SassForBoundaryKind {
1919    Inclusive,
1920    Exclusive,
1921}
1922
1923#[derive(Debug)]
1924#[cfg_attr(feature = "serialize", derive(Serialize))]
1925#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1926pub struct SassForward<'a> {
1927    pub span: Span,
1928    pub path: InterpolableStr<'a>,
1929    pub prefix: Option<SassForwardPrefix<'a>>,
1930    pub visibility: Option<SassForwardVisibility<'a>>,
1931    pub config: Option<SassModuleConfig<'a>>,
1932}
1933
1934#[derive(Debug)]
1935#[cfg_attr(feature = "serialize", derive(Serialize))]
1936#[cfg_attr(feature = "serialize", serde(untagged))]
1937pub enum SassForwardMember<'a> {
1938    Ident(Ident<'a>),
1939    Variable(SassVariable<'a>),
1940}
1941
1942#[derive(Debug)]
1943#[cfg_attr(feature = "serialize", derive(Serialize))]
1944#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1945pub struct SassForwardPrefix<'a> {
1946    pub span: Span,
1947    pub as_span: Span,
1948    pub name: Ident<'a>,
1949}
1950
1951#[derive(Debug)]
1952#[cfg_attr(feature = "serialize", derive(Serialize))]
1953#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1954pub struct SassForwardVisibility<'a> {
1955    pub span: Span,
1956    pub modifier: SassForwardVisibilityModifier,
1957    pub members: Vec<'a, SassForwardMember<'a>>,
1958    pub comma_spans: Vec<'a, Span>,
1959}
1960
1961#[derive(Debug)]
1962#[cfg_attr(feature = "serialize", derive(Serialize))]
1963#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1964pub struct SassForwardVisibilityModifier {
1965    pub span: Span,
1966    pub kind: SassForwardVisibilityModifierKind,
1967}
1968
1969#[derive(Debug)]
1970#[cfg_attr(feature = "serialize", derive(Serialize))]
1971pub enum SassForwardVisibilityModifierKind {
1972    Hide,
1973    Show,
1974}
1975
1976#[derive(Debug)]
1977#[cfg_attr(feature = "serialize", derive(Serialize))]
1978#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1979pub struct SassFunction<'a> {
1980    pub span: Span,
1981    pub name: Ident<'a>,
1982    pub parameters: SassParameters<'a>,
1983}
1984
1985#[derive(Debug)]
1986#[cfg_attr(feature = "serialize", derive(Serialize))]
1987#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1988pub struct SassIfAtRule<'a> {
1989    pub span: Span,
1990    pub if_clause: SassConditionalClause<'a>,
1991    pub else_if_clauses: Vec<'a, SassConditionalClause<'a>>,
1992    pub else_clause: Option<SimpleBlock<'a>>,
1993    pub else_spans: Vec<'a, Span>,
1994}
1995
1996#[derive(Debug)]
1997#[cfg_attr(feature = "serialize", derive(Serialize))]
1998#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
1999pub struct SassImportPrelude<'a> {
2000    pub span: Span,
2001    pub paths: Vec<'a, Str<'a>>,
2002    pub comma_spans: Vec<'a, Span>,
2003}
2004
2005#[derive(Debug)]
2006#[cfg_attr(feature = "serialize", derive(Serialize))]
2007#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2008pub struct SassInclude<'a> {
2009    pub span: Span,
2010    pub name: FunctionName<'a>,
2011    pub arguments: Option<SassIncludeArgs<'a>>,
2012    pub content_block_params: Option<SassIncludeContentBlockParams<'a>>,
2013}
2014
2015#[derive(Debug)]
2016#[cfg_attr(feature = "serialize", derive(Serialize))]
2017#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2018pub struct SassIncludeArgs<'a> {
2019    pub span: Span,
2020    pub args: Vec<'a, ComponentValue<'a>>,
2021    pub comma_spans: Vec<'a, Span>,
2022}
2023
2024#[derive(Debug)]
2025#[cfg_attr(feature = "serialize", derive(Serialize))]
2026#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2027pub struct SassIncludeContentBlockParams<'a> {
2028    pub span: Span,
2029    pub using_span: Span,
2030    pub params: SassParameters<'a>,
2031}
2032
2033#[derive(Debug)]
2034#[cfg_attr(feature = "serialize", derive(Serialize))]
2035#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2036pub struct SassInterpolatedIdent<'a> {
2037    pub span: Span,
2038    pub elements: Vec<'a, SassInterpolatedIdentElement<'a>>,
2039}
2040
2041#[derive(Debug)]
2042#[cfg_attr(feature = "serialize", derive(Serialize))]
2043#[cfg_attr(feature = "serialize", serde(untagged))]
2044pub enum SassInterpolatedIdentElement<'a> {
2045    Expression(ComponentValue<'a>),
2046    Static(InterpolableIdentStaticPart<'a>),
2047}
2048
2049#[derive(Debug)]
2050#[cfg_attr(feature = "serialize", derive(Serialize))]
2051#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2052pub struct SassInterpolatedStr<'a> {
2053    pub span: Span,
2054    pub elements: Vec<'a, SassInterpolatedStrElement<'a>>,
2055}
2056
2057#[derive(Debug)]
2058#[cfg_attr(feature = "serialize", derive(Serialize))]
2059#[cfg_attr(feature = "serialize", serde(untagged))]
2060pub enum SassInterpolatedStrElement<'a> {
2061    Expression(ComponentValue<'a>),
2062    Static(InterpolableStrStaticPart<'a>),
2063}
2064
2065#[derive(Debug)]
2066#[cfg_attr(feature = "serialize", derive(Serialize))]
2067#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2068pub struct SassInterpolatedUrl<'a> {
2069    pub span: Span,
2070    pub elements: Vec<'a, SassInterpolatedUrlElement<'a>>,
2071}
2072
2073#[derive(Debug)]
2074#[cfg_attr(feature = "serialize", derive(Serialize))]
2075#[cfg_attr(feature = "serialize", serde(untagged))]
2076pub enum SassInterpolatedUrlElement<'a> {
2077    Expression(ComponentValue<'a>),
2078    Static(InterpolableUrlStaticPart<'a>),
2079}
2080
2081#[derive(Debug)]
2082#[cfg_attr(feature = "serialize", derive(Serialize))]
2083#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2084pub struct SassKeywordArgument<'a> {
2085    pub span: Span,
2086    pub name: SassVariable<'a>,
2087    pub colon_span: Span,
2088    pub value: Box<'a, ComponentValue<'a>>,
2089}
2090
2091#[derive(Debug)]
2092#[cfg_attr(feature = "serialize", derive(Serialize))]
2093#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2094pub struct SassList<'a> {
2095    pub span: Span,
2096    pub elements: Vec<'a, ComponentValue<'a>>,
2097    pub comma_spans: Option<Vec<'a, Span>>,
2098}
2099
2100#[derive(Debug)]
2101#[cfg_attr(feature = "serialize", derive(Serialize))]
2102#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2103pub struct SassMap<'a> {
2104    pub span: Span,
2105    pub items: Vec<'a, SassMapItem<'a>>,
2106    pub comma_spans: Vec<'a, Span>,
2107}
2108
2109#[derive(Debug)]
2110#[cfg_attr(feature = "serialize", derive(Serialize))]
2111#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2112pub struct SassMapItem<'a> {
2113    pub span: Span,
2114    pub key: ComponentValue<'a>,
2115    pub colon_span: Span,
2116    pub value: ComponentValue<'a>,
2117}
2118
2119#[derive(Debug)]
2120#[cfg_attr(feature = "serialize", derive(Serialize))]
2121#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2122pub struct SassMixin<'a> {
2123    pub span: Span,
2124    pub name: Ident<'a>,
2125    pub parameters: Option<SassParameters<'a>>,
2126}
2127
2128#[derive(Debug)]
2129#[cfg_attr(feature = "serialize", derive(Serialize))]
2130#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2131pub struct SassModuleConfig<'a> {
2132    pub span: Span,
2133    pub with_span: Span,
2134    pub lparen_span: Span,
2135    pub items: Vec<'a, SassModuleConfigItem<'a>>,
2136    pub comma_spans: Vec<'a, Span>,
2137}
2138
2139#[derive(Debug)]
2140#[cfg_attr(feature = "serialize", derive(Serialize))]
2141#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2142pub struct SassModuleConfigItem<'a> {
2143    pub span: Span,
2144    pub variable: SassVariable<'a>,
2145    pub colon_span: Span,
2146    pub value: ComponentValue<'a>,
2147    pub flags: Vec<'a, SassFlag<'a>>,
2148}
2149
2150#[derive(Debug)]
2151#[cfg_attr(feature = "serialize", derive(Serialize))]
2152#[cfg_attr(feature = "serialize", serde(untagged))]
2153pub enum SassModuleMemberName<'a> {
2154    Ident(Ident<'a>),
2155    Variable(SassVariable<'a>),
2156}
2157
2158#[derive(Debug)]
2159#[cfg_attr(feature = "serialize", derive(Serialize))]
2160#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2161pub struct SassNestingDeclaration<'a> {
2162    pub span: Span,
2163    pub block: SimpleBlock<'a>,
2164}
2165
2166#[derive(Debug)]
2167#[cfg_attr(feature = "serialize", derive(Serialize))]
2168#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2169pub struct SassParameter<'a> {
2170    pub span: Span,
2171    pub name: SassVariable<'a>,
2172    pub default_value: Option<SassParameterDefaultValue<'a>>,
2173}
2174
2175#[derive(Debug)]
2176#[cfg_attr(feature = "serialize", derive(Serialize))]
2177#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2178pub struct SassParameterDefaultValue<'a> {
2179    pub span: Span,
2180    pub colon_span: Span,
2181    pub value: ComponentValue<'a>,
2182}
2183
2184#[derive(Debug)]
2185#[cfg_attr(feature = "serialize", derive(Serialize))]
2186#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2187pub struct SassParameters<'a> {
2188    pub span: Span,
2189    pub params: Vec<'a, SassParameter<'a>>,
2190    pub arbitrary_param: Option<SassArbitraryParameter<'a>>,
2191    pub comma_spans: Vec<'a, Span>,
2192}
2193
2194#[derive(Debug)]
2195#[cfg_attr(feature = "serialize", derive(Serialize))]
2196#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2197pub struct SassParenthesizedExpression<'a> {
2198    pub span: Span,
2199    pub expr: Box<'a, ComponentValue<'a>>,
2200}
2201
2202#[derive(Debug)]
2203#[cfg_attr(feature = "serialize", derive(Serialize))]
2204#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2205pub struct SassPlaceholderSelector<'a> {
2206    pub span: Span,
2207    pub name: InterpolableIdent<'a>,
2208}
2209
2210#[derive(Debug)]
2211#[cfg_attr(feature = "serialize", derive(Serialize))]
2212#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2213pub struct SassQualifiedName<'a> {
2214    pub span: Span,
2215    pub module: Ident<'a>,
2216    pub member: SassModuleMemberName<'a>,
2217}
2218
2219#[derive(Debug)]
2220#[cfg_attr(feature = "serialize", derive(Serialize))]
2221#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2222pub struct SassUnaryExpression<'a> {
2223    pub span: Span,
2224    pub op: SassUnaryOperator,
2225    pub expr: Box<'a, ComponentValue<'a>>,
2226}
2227
2228#[derive(Debug)]
2229#[cfg_attr(feature = "serialize", derive(Serialize))]
2230#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2231pub struct SassUnaryOperator {
2232    pub span: Span,
2233    pub kind: SassUnaryOperatorKind,
2234}
2235
2236#[derive(Debug)]
2237#[cfg_attr(feature = "serialize", derive(Serialize))]
2238pub enum SassUnaryOperatorKind {
2239    Plus,
2240    Minus,
2241    Not,
2242}
2243
2244#[derive(Debug)]
2245#[cfg_attr(feature = "serialize", derive(Serialize))]
2246#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2247pub struct SassUnnamedNamespace {
2248    pub span: Span,
2249}
2250
2251#[derive(Debug)]
2252#[cfg_attr(feature = "serialize", derive(Serialize))]
2253#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2254pub struct SassUse<'a> {
2255    pub span: Span,
2256    pub path: InterpolableStr<'a>,
2257    pub namespace: Option<SassUseNamespace<'a>>,
2258    pub config: Option<SassModuleConfig<'a>>,
2259}
2260
2261#[derive(Debug)]
2262#[cfg_attr(feature = "serialize", derive(Serialize))]
2263#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2264pub struct SassUseNamespace<'a> {
2265    pub span: Span,
2266    pub as_span: Span,
2267    pub kind: SassUseNamespaceKind<'a>,
2268}
2269
2270#[derive(Debug)]
2271#[cfg_attr(feature = "serialize", derive(Serialize))]
2272#[cfg_attr(feature = "serialize", serde(untagged))]
2273pub enum SassUseNamespaceKind<'a> {
2274    Named(Ident<'a>),
2275    Unnamed(SassUnnamedNamespace),
2276}
2277
2278#[derive(Debug)]
2279#[cfg_attr(feature = "serialize", derive(Serialize))]
2280#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2281pub struct SassVariable<'a> {
2282    pub span: Span,
2283    pub name: Ident<'a>,
2284}
2285
2286#[derive(Debug)]
2287#[cfg_attr(feature = "serialize", derive(Serialize))]
2288#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2289pub struct SassVariableDeclaration<'a> {
2290    pub span: Span,
2291    pub namespace: Option<Ident<'a>>,
2292    pub name: SassVariable<'a>,
2293    pub colon_span: Span,
2294    pub value: ComponentValue<'a>,
2295    pub flags: Vec<'a, SassFlag<'a>>,
2296}
2297
2298#[derive(Debug)]
2299#[cfg_attr(feature = "serialize", derive(Serialize))]
2300#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2301pub struct ScopeEnd<'a> {
2302    pub span: Span,
2303    pub to_span: Span,
2304    pub lparen_span: Span,
2305    pub selector: Option<SelectorList<'a>>,
2306}
2307
2308#[derive(Debug)]
2309#[cfg_attr(feature = "serialize", derive(Serialize))]
2310#[cfg_attr(feature = "serialize", serde(untagged))]
2311pub enum ScopePrelude<'a> {
2312    StartOnly(ScopeStart<'a>),
2313    EndOnly(ScopeEnd<'a>),
2314    Both(ScopeStartWithEnd<'a>),
2315}
2316
2317#[derive(Debug)]
2318#[cfg_attr(feature = "serialize", derive(Serialize))]
2319#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2320pub struct ScopeStart<'a> {
2321    pub span: Span,
2322    pub selector: Option<SelectorList<'a>>,
2323}
2324
2325#[derive(Debug)]
2326#[cfg_attr(feature = "serialize", derive(Serialize))]
2327#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2328pub struct ScopeStartWithEnd<'a> {
2329    pub span: Span,
2330    pub start: ScopeStart<'a>,
2331    pub end: ScopeEnd<'a>,
2332}
2333
2334#[derive(Debug)]
2335#[cfg_attr(feature = "serialize", derive(Serialize))]
2336#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2337pub struct SelectorList<'a> {
2338    pub span: Span,
2339    pub selectors: Vec<'a, ComplexSelector<'a>>,
2340    pub comma_spans: Vec<'a, Span>,
2341}
2342
2343#[derive(Debug)]
2344#[cfg_attr(feature = "serialize", derive(Serialize))]
2345#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2346pub struct SimpleBlock<'a> {
2347    pub span: Span,
2348    pub statements: Vec<'a, Statement<'a>>,
2349}
2350
2351#[derive(Debug)]
2352#[cfg_attr(feature = "serialize", derive(Serialize))]
2353#[cfg_attr(feature = "serialize", serde(untagged))]
2354pub enum SimpleSelector<'a> {
2355    Class(ClassSelector<'a>),
2356    Id(IdSelector<'a>),
2357    Type(TypeSelector<'a>),
2358    Attribute(Box<'a, AttributeSelector<'a>>),
2359    PseudoClass(Box<'a, PseudoClassSelector<'a>>),
2360    PseudoElement(Box<'a, PseudoElementSelector<'a>>),
2361    Nesting(NestingSelector<'a>),
2362    SassPlaceholder(SassPlaceholderSelector<'a>),
2363}
2364
2365#[derive(Debug)]
2366#[cfg_attr(feature = "serialize", derive(Serialize))]
2367#[cfg_attr(feature = "serialize", serde(untagged))]
2368pub enum Statement<'a> {
2369    AtRule(AtRule<'a>),
2370    Declaration(Declaration<'a>),
2371    KeyframeBlock(KeyframeBlock<'a>),
2372    LessConditionalQualifiedRule(LessConditionalQualifiedRule<'a>),
2373    LessExtendRule(LessExtendRule<'a>),
2374    LessFunctionCall(Function<'a>),
2375    LessMixinCall(LessMixinCall<'a>),
2376    LessMixinDefinition(Box<'a, LessMixinDefinition<'a>>),
2377    LessVariableCall(LessVariableCall<'a>),
2378    LessVariableDeclaration(Box<'a, LessVariableDeclaration<'a>>),
2379    Placeholder(Placeholder<'a>),
2380    PostcssSimpleVarDeclaration(Box<'a, PostcssSimpleVarDeclaration<'a>>),
2381    QualifiedRule(QualifiedRule<'a>),
2382    SassIfAtRule(Box<'a, SassIfAtRule<'a>>),
2383    SassVariableDeclaration(Box<'a, SassVariableDeclaration<'a>>),
2384    UnknownQualifiedRule(UnknownQualifiedRule<'a>),
2385    UnknownSassAtRule(Box<'a, UnknownSassAtRule<'a>>),
2386}
2387
2388#[derive(Debug)]
2389#[cfg_attr(feature = "serialize", derive(Serialize))]
2390#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2391pub struct Str<'a> {
2392    pub span: Span,
2393    pub value: &'a str,
2394    pub raw: &'a str,
2395}
2396
2397#[derive(Debug)]
2398#[cfg_attr(feature = "serialize", derive(Serialize))]
2399#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2400pub struct StyleCondition<'a> {
2401    pub span: Span,
2402    pub conditions: Vec<'a, StyleConditionKind<'a>>,
2403}
2404
2405#[derive(Debug)]
2406#[cfg_attr(feature = "serialize", derive(Serialize))]
2407#[cfg_attr(feature = "serialize", serde(untagged))]
2408pub enum StyleConditionKind<'a> {
2409    StyleInParens(StyleInParens<'a>),
2410    And(StyleConditionAnd<'a>),
2411    Or(StyleConditionOr<'a>),
2412    Not(StyleConditionNot<'a>),
2413}
2414
2415#[derive(Debug)]
2416#[cfg_attr(feature = "serialize", derive(Serialize))]
2417#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2418pub struct StyleConditionAnd<'a> {
2419    pub span: Span,
2420    pub keyword: Ident<'a>,
2421    pub style_in_parens: StyleInParens<'a>,
2422}
2423
2424#[derive(Debug)]
2425#[cfg_attr(feature = "serialize", derive(Serialize))]
2426#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2427pub struct StyleConditionNot<'a> {
2428    pub span: Span,
2429    pub keyword: Ident<'a>,
2430    pub style_in_parens: StyleInParens<'a>,
2431}
2432
2433#[derive(Debug)]
2434#[cfg_attr(feature = "serialize", derive(Serialize))]
2435#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2436pub struct StyleConditionOr<'a> {
2437    pub span: Span,
2438    pub keyword: Ident<'a>,
2439    pub style_in_parens: StyleInParens<'a>,
2440}
2441
2442#[derive(Debug)]
2443#[cfg_attr(feature = "serialize", derive(Serialize))]
2444#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2445pub struct StyleInParens<'a> {
2446    pub span: Span,
2447    pub kind: StyleInParensKind<'a>,
2448}
2449
2450#[derive(Debug)]
2451#[cfg_attr(feature = "serialize", derive(Serialize))]
2452#[cfg_attr(feature = "serialize", serde(untagged))]
2453pub enum StyleInParensKind<'a> {
2454    Condition(StyleCondition<'a>),
2455    Feature(Declaration<'a>),
2456}
2457
2458#[derive(Debug)]
2459#[cfg_attr(feature = "serialize", derive(Serialize))]
2460#[cfg_attr(feature = "serialize", serde(untagged))]
2461pub enum StyleQuery<'a> {
2462    Condition(StyleCondition<'a>),
2463    Feature(Declaration<'a>),
2464    /// A bare `<custom-property-name>` existence test: `style(--theme)`
2465    /// (css-conditional-5 `<style-feature>`).
2466    FeatureName(InterpolableIdent<'a>),
2467}
2468
2469#[derive(Debug)]
2470#[cfg_attr(feature = "serialize", derive(Serialize))]
2471#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2472pub struct Stylesheet<'a> {
2473    pub span: Span,
2474    pub statements: Vec<'a, Statement<'a>>,
2475}
2476
2477#[derive(Debug)]
2478#[cfg_attr(feature = "serialize", derive(Serialize))]
2479#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2480pub struct SupportsAnd<'a> {
2481    pub span: Span,
2482    pub keyword: Ident<'a>,
2483    pub condition: SupportsInParens<'a>,
2484}
2485
2486#[derive(Debug)]
2487#[cfg_attr(feature = "serialize", derive(Serialize))]
2488#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2489pub struct SupportsCondition<'a> {
2490    pub span: Span,
2491    pub conditions: Vec<'a, SupportsConditionKind<'a>>,
2492}
2493
2494#[derive(Debug)]
2495#[cfg_attr(feature = "serialize", derive(Serialize))]
2496#[cfg_attr(feature = "serialize", serde(untagged))]
2497pub enum SupportsConditionKind<'a> {
2498    Not(SupportsNot<'a>),
2499    And(SupportsAnd<'a>),
2500    Or(SupportsOr<'a>),
2501    SupportsInParens(SupportsInParens<'a>),
2502}
2503
2504#[derive(Debug)]
2505#[cfg_attr(feature = "serialize", derive(Serialize))]
2506#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2507pub struct SupportsDecl<'a> {
2508    pub span: Span,
2509    pub decl: Declaration<'a>,
2510}
2511
2512#[derive(Debug)]
2513#[cfg_attr(feature = "serialize", derive(Serialize))]
2514#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2515pub struct SupportsInParens<'a> {
2516    pub span: Span,
2517    pub kind: SupportsInParensKind<'a>,
2518}
2519
2520#[derive(Debug)]
2521#[cfg_attr(feature = "serialize", derive(Serialize))]
2522#[cfg_attr(feature = "serialize", serde(untagged))]
2523pub enum SupportsInParensKind<'a> {
2524    SupportsCondition(SupportsCondition<'a>),
2525    Feature(Box<'a, SupportsDecl<'a>>),
2526    Selector(SelectorList<'a>),
2527    Function(Function<'a>),
2528    GeneralEnclosed(TokenSeq<'a>),
2529    /// Sass only: a lone interpolation as a condition operand,
2530    /// e.g. `@supports #{"(a: b)"} { ... }`.
2531    Interpolation(InterpolableIdent<'a>),
2532}
2533
2534#[derive(Debug)]
2535#[cfg_attr(feature = "serialize", derive(Serialize))]
2536#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2537pub struct SupportsNot<'a> {
2538    pub span: Span,
2539    pub keyword: Ident<'a>,
2540    pub condition: SupportsInParens<'a>,
2541}
2542
2543#[derive(Debug)]
2544#[cfg_attr(feature = "serialize", derive(Serialize))]
2545#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2546pub struct SupportsOr<'a> {
2547    pub span: Span,
2548    pub keyword: Ident<'a>,
2549    pub condition: SupportsInParens<'a>,
2550}
2551
2552#[derive(Debug)]
2553#[cfg_attr(feature = "serialize", derive(Serialize))]
2554#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2555pub struct TagNameSelector<'a> {
2556    pub span: Span,
2557    pub name: WqName<'a>,
2558}
2559
2560#[derive(Debug)]
2561#[cfg_attr(feature = "serialize", derive(Serialize))]
2562#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2563pub struct TokenSeq<'a> {
2564    pub span: Span,
2565    pub tokens: Vec<'a, TokenWithSpan<'a>>,
2566}
2567
2568#[derive(Debug)]
2569#[cfg_attr(feature = "serialize", derive(Serialize))]
2570#[cfg_attr(feature = "serialize", serde(untagged))]
2571pub enum TypeSelector<'a> {
2572    TagName(TagNameSelector<'a>),
2573    Universal(UniversalSelector<'a>),
2574}
2575
2576#[derive(Debug)]
2577#[cfg_attr(feature = "serialize", derive(Serialize))]
2578#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2579pub struct UnicodeRange<'a> {
2580    pub span: Span,
2581    pub prefix: char,
2582    pub start: u32,
2583    pub start_raw: &'a str,
2584    pub end: u32,
2585    pub end_raw: Option<&'a str>,
2586}
2587
2588#[derive(Debug)]
2589#[cfg_attr(feature = "serialize", derive(Serialize))]
2590#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2591pub struct UniversalSelector<'a> {
2592    pub span: Span,
2593    pub prefix: Option<NsPrefix<'a>>,
2594}
2595
2596#[derive(Debug)]
2597#[cfg_attr(feature = "serialize", derive(Serialize))]
2598#[cfg_attr(feature = "serialize", serde(untagged))]
2599pub enum UnknownAtRulePrelude<'a> {
2600    ComponentValue(ComponentValue<'a>),
2601    TokenSeq(TokenSeq<'a>),
2602}
2603
2604/// A qualified rule whose prelude matches no selector grammar and is kept as raw tokens:
2605/// declaration-shaped (`sans: "Sans" { ... }`) or numeric-led (`50% { ... }` outside `@keyframes`).
2606/// See the `Parse` impl for the CSS Syntax algorithms; postcss keeps both shapes.
2607#[derive(Debug)]
2608#[cfg_attr(feature = "serialize", derive(Serialize))]
2609#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2610pub struct UnknownQualifiedRule<'a> {
2611    pub span: Span,
2612    pub prelude: TokenSeq<'a>,
2613    pub block: SimpleBlock<'a>,
2614}
2615
2616#[derive(Debug)]
2617#[cfg_attr(feature = "serialize", derive(Serialize))]
2618#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2619pub struct UnknownSassAtRule<'a> {
2620    pub span: Span,
2621    pub name: InterpolableIdent<'a>,
2622    pub prelude: Option<UnknownAtRulePrelude<'a>>,
2623    pub block: Option<SimpleBlock<'a>>,
2624}
2625
2626#[derive(Debug)]
2627#[cfg_attr(feature = "serialize", derive(Serialize))]
2628#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2629pub struct UnquotedFontFamilyName<'a> {
2630    pub span: Span,
2631    pub idents: Vec<'a, InterpolableIdent<'a>>,
2632}
2633
2634#[derive(Debug)]
2635#[cfg_attr(feature = "serialize", derive(Serialize))]
2636#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2637pub struct Url<'a> {
2638    pub span: Span,
2639    pub name: Ident<'a>,
2640    pub value: Option<UrlValue<'a>>,
2641    pub modifiers: Vec<'a, UrlModifier<'a>>,
2642}
2643
2644#[derive(Debug)]
2645#[cfg_attr(feature = "serialize", derive(Serialize))]
2646#[cfg_attr(feature = "serialize", serde(untagged))]
2647pub enum UrlModifier<'a> {
2648    Ident(InterpolableIdent<'a>),
2649    Function(Function<'a>),
2650}
2651
2652/// `)` is excluded
2653#[derive(Debug)]
2654#[cfg_attr(feature = "serialize", derive(Serialize))]
2655#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2656pub struct UrlRaw<'a> {
2657    pub span: Span,
2658    pub value: &'a str,
2659    pub raw: &'a str,
2660}
2661
2662#[derive(Debug)]
2663#[cfg_attr(feature = "serialize", derive(Serialize))]
2664#[cfg_attr(feature = "serialize", serde(untagged))]
2665pub enum UrlValue<'a> {
2666    Raw(UrlRaw<'a>),
2667    SassInterpolated(SassInterpolatedUrl<'a>),
2668    Str(InterpolableStr<'a>),
2669    LessEscapedStr(LessEscapedStr<'a>),
2670}
2671
2672#[derive(Debug)]
2673#[cfg_attr(feature = "serialize", derive(Serialize))]
2674#[cfg_attr(feature = "serialize", serde(tag = "type", rename_all = "camelCase"))]
2675pub struct WqName<'a> {
2676    pub span: Span,
2677    pub name: InterpolableIdent<'a>,
2678    pub prefix: Option<NsPrefix<'a>>,
2679}
2680
2681#[cfg(target_pointer_width = "64")]
2682const _: () = {
2683    assert!(size_of::<SimpleSelector<'static>>() == 160);
2684    assert!(size_of::<MediaFeature<'static>>() == 88);
2685    assert!(size_of::<MediaQuery<'static>>() == 96);
2686};