css_ast/values/backgrounds/mod.rs
1#![allow(warnings)]
2//! https://drafts.csswg.org/css-backgrounds-4/
3
4mod impls;
5use super::prelude::*;
6use impls::*;
7// /// Represents the style value for `background` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background).
8// ///
9// /// The background CSS property is a shorthand that sets several background properties at once.
10// ///
11// /// The grammar is defined as:
12// ///
13// /// ```text,ignore
14// /// <bg-layer>#? , <final-bg-layer>
15// /// ```
16// ///
17// /// https://drafts.csswg.org/css-backgrounds-4/#background
18// #[syntax(" <bg-layer>#? , <final-bg-layer> ")]
19// #[derive(
20// Parse,
21// Peek,
22// ToSpan,
23// ToCursors,
24// DeclarationMetadata,
25// SemanticEq,
26// Debug,
27// Clone,
28// PartialEq,
29// Eq,
30// PartialOrd,
31// Ord,
32// Hash,
33// )]
34// #[declaration_metadata(
35// initial = "see individual properties",
36// applies_to = Elements,
37// percentages = Unknown,
38// animation_type = Unknown,
39// property_group = Backgrounds,
40// computed_value_type = Unknown,
41// canonical_order = "per grammar",
42// )]
43// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
44// #[cfg_attr(
45// feature = "css_feature_data",
46// derive(ToCSSFeature),
47// css_feature("css.properties.background")
48// )]
49// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
50// pub struct BackgroundStyleValue<'a>;
51
52/// Represents the style value for `background-attachment` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-attachment).
53///
54/// The background-attachment CSS property sets whether an element's background image or gradient moves as the element scrolls.
55///
56/// The grammar is defined as:
57///
58/// ```text,ignore
59/// <attachment>#
60/// ```
61///
62/// https://drafts.csswg.org/css-backgrounds-4/#background-attachment
63#[syntax(" <attachment># ")]
64#[derive(
65 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
66)]
67#[declaration_metadata(
68 initial = "scroll",
69 applies_to = Elements,
70 animation_type = Discrete,
71 property_group = Backgrounds,
72 computed_value_type = Unknown,
73 canonical_order = "per grammar",
74)]
75#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
76#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-attachment"))]
77#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
78pub struct BackgroundAttachmentStyleValue<'a>;
79
80/// Represents the style value for `background-clip` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-clip).
81///
82/// The background-clip CSS property sets the extent of the background: the padding box, the content box, or the default border box.
83///
84/// The grammar is defined as:
85///
86/// ```text,ignore
87/// <bg-clip>#
88/// ```
89///
90/// https://drafts.csswg.org/css-backgrounds-4/#background-clip
91#[syntax(" <bg-clip># ")]
92#[derive(
93 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
94)]
95#[declaration_metadata(
96 initial = "border-box",
97 applies_to = Elements,
98 animation_type = RepeatableList,
99 property_group = Backgrounds,
100 computed_value_type = AsSpecified,
101 canonical_order = "per grammar",
102)]
103#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
104#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-clip"))]
105#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
106pub struct BackgroundClipStyleValue<'a>;
107
108/// Represents the style value for `background-color` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-color).
109///
110/// The background-color CSS property sets the fill color of an element, behind any content and background images or gradients.
111///
112/// The grammar is defined as:
113///
114/// ```text,ignore
115/// <color>
116/// ```
117///
118/// https://drafts.csswg.org/css-backgrounds-4/#background-color
119#[syntax(" <color> ")]
120#[derive(
121 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
122)]
123#[declaration_metadata(
124 initial = "transparent",
125 applies_to = Elements,
126 animation_type = ByComputedValue,
127 property_group = Backgrounds,
128 computed_value_type = Unknown,
129 canonical_order = "per grammar",
130)]
131#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
132#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-color"))]
133#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
134pub struct BackgroundColorStyleValue;
135
136/// Represents the style value for `background-image` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-image).
137///
138/// The background-image CSS property sets the graphics to display behind the content of an element and in front of the background color. Graphics may be any combination of images or gradients.
139///
140/// The grammar is defined as:
141///
142/// ```text,ignore
143/// <bg-image>#
144/// ```
145///
146/// https://drafts.csswg.org/css-backgrounds-4/#background-image
147#[syntax(" <bg-image># ")]
148#[derive(
149 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
150)]
151#[declaration_metadata(
152 initial = "none",
153 applies_to = Elements,
154 animation_type = Discrete,
155 property_group = Backgrounds,
156 computed_value_type = Unknown,
157 canonical_order = "per grammar",
158)]
159#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
160#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-image"))]
161#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
162pub struct BackgroundImageStyleValue<'a>;
163
164/// Represents the style value for `background-origin` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-origin).
165///
166/// The background-origin CSS property sets the background starting position relative to the border and padding of an element.
167///
168/// The grammar is defined as:
169///
170/// ```text,ignore
171/// <visual-box>#
172/// ```
173///
174/// https://drafts.csswg.org/css-backgrounds-4/#background-origin
175#[syntax(" <visual-box># ")]
176#[derive(
177 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
178)]
179#[declaration_metadata(
180 initial = "padding-box",
181 applies_to = Elements,
182 animation_type = RepeatableList,
183 property_group = Backgrounds,
184 computed_value_type = Unknown,
185 canonical_order = "per grammar",
186)]
187#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
188#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-origin"))]
189#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
190pub struct BackgroundOriginStyleValue<'a>;
191
192// /// Represents the style value for `background-position` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-position).
193// ///
194// /// The background-position CSS property offsets the initial position of background images relative to the background origin.
195// ///
196// /// The grammar is defined as:
197// ///
198// /// ```text,ignore
199// /// <bg-position>#
200// /// ```
201// ///
202// /// https://drafts.csswg.org/css-backgrounds-4/#background-position
203// #[syntax(" <bg-position># ")]
204// #[derive(
205// Parse,
206// Peek,
207// ToSpan,
208// ToCursors,
209// DeclarationMetadata,
210// SemanticEq,
211// Debug,
212// Clone,
213// PartialEq,
214// Eq,
215// PartialOrd,
216// Ord,
217// Hash,
218// )]
219// #[declaration_metadata(
220// initial = "0% 0%",
221// applies_to = Elements,
222// percentages = BackgroundPositioningArea,
223// animation_type = RepeatableList,
224// property_group = Backgrounds,
225// computed_value_type = Unknown,
226// canonical_order = "per grammar",
227// )]
228// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
229// #[cfg_attr(
230// feature = "css_feature_data",
231// derive(ToCSSFeature),
232// css_feature("css.properties.background-position")
233// )]
234// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
235// pub struct BackgroundPositionStyleValue<'a>;
236
237// /// Represents the style value for `background-position-block` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-position-block).
238// ///
239// /// The grammar is defined as:
240// ///
241// /// ```text,ignore
242// /// [ center | [ [ start | end ]? <length-percentage>? ]! ]#
243// /// ```
244// ///
245// /// https://drafts.csswg.org/css-backgrounds-4/#background-position-block
246// #[syntax(" [ center | [ [ start | end ]? <length-percentage>? ]! ]# ")]
247// #[derive(
248// Parse,
249// Peek,
250// ToSpan,
251// ToCursors,
252// DeclarationMetadata,
253// SemanticEq,
254// Debug,
255// Clone,
256// PartialEq,
257// Eq,
258// PartialOrd,
259// Ord,
260// Hash,
261// )]
262// #[declaration_metadata(
263// initial = "0%",
264// applies_to = Elements,
265// percentages = BackgroundPositioningArea,
266// animation_type = RepeatableList,
267// property_group = Backgrounds,
268// computed_value_type = Unknown,
269// canonical_order = "per grammar",
270// logical_property_group = BackgroundPosition,
271// box_side = BlockStart|BlockEnd,
272// )]
273// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
274// #[cfg_attr(
275// feature = "css_feature_data",
276// derive(ToCSSFeature),
277// css_feature("css.properties.background-position-block")
278// )]
279// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
280// pub struct BackgroundPositionBlockStyleValue<'a>;
281
282// /// Represents the style value for `background-position-inline` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-position-inline).
283// ///
284// /// The grammar is defined as:
285// ///
286// /// ```text,ignore
287// /// [ center | [ [ start | end ]? <length-percentage>? ]! ]#
288// /// ```
289// ///
290// /// https://drafts.csswg.org/css-backgrounds-4/#background-position-inline
291// #[syntax(" [ center | [ [ start | end ]? <length-percentage>? ]! ]# ")]
292// #[derive(
293// Parse,
294// Peek,
295// ToSpan,
296// ToCursors,
297// DeclarationMetadata,
298// SemanticEq,
299// Debug,
300// Clone,
301// PartialEq,
302// Eq,
303// PartialOrd,
304// Ord,
305// Hash,
306// )]
307// #[declaration_metadata(
308// initial = "0%",
309// applies_to = Elements,
310// percentages = BackgroundPositioningArea,
311// animation_type = RepeatableList,
312// property_group = Backgrounds,
313// computed_value_type = Unknown,
314// canonical_order = "per grammar",
315// logical_property_group = BackgroundPosition,
316// box_side = InlineStart|InlineEnd,
317// )]
318// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
319// #[cfg_attr(
320// feature = "css_feature_data",
321// derive(ToCSSFeature),
322// css_feature("css.properties.background-position-inline")
323// )]
324// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
325// pub struct BackgroundPositionInlineStyleValue<'a>;
326
327// /// Represents the style value for `background-position-x` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-position-x).
328// ///
329// /// The background-position CSS property offsets the initial position of background images relative to the background origin.
330// ///
331// /// The grammar is defined as:
332// ///
333// /// ```text,ignore
334// /// [ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]#
335// /// ```
336// ///
337// /// https://drafts.csswg.org/css-backgrounds-4/#background-position-x
338// #[syntax(
339// " [ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]# "
340// )]
341// #[derive(
342// Parse,
343// Peek,
344// ToSpan,
345// ToCursors,
346// DeclarationMetadata,
347// SemanticEq,
348// Debug,
349// Clone,
350// PartialEq,
351// Eq,
352// PartialOrd,
353// Ord,
354// Hash,
355// )]
356// #[declaration_metadata(
357// initial = "0%",
358// applies_to = Elements,
359// percentages = BackgroundPositioningArea,
360// animation_type = RepeatableList,
361// property_group = Backgrounds,
362// computed_value_type = Unknown,
363// canonical_order = "per grammar",
364// logical_property_group = BackgroundPosition,
365// )]
366// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
367// #[cfg_attr(
368// feature = "css_feature_data",
369// derive(ToCSSFeature),
370// css_feature("css.properties.background-position-x")
371// )]
372// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
373// pub struct BackgroundPositionXStyleValue<'a>;
374
375// /// Represents the style value for `background-position-y` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-position-y).
376// ///
377// /// The background-position CSS property offsets the initial position of background images relative to the background origin.
378// ///
379// /// The grammar is defined as:
380// ///
381// /// ```text,ignore
382// /// [ center | [ [ top | bottom | y-start | y-end ]? <length-percentage>? ]! ]#
383// /// ```
384// ///
385// /// https://drafts.csswg.org/css-backgrounds-4/#background-position-y
386// #[syntax(
387// " [ center | [ [ top | bottom | y-start | y-end ]? <length-percentage>? ]! ]# "
388// )]
389// #[derive(
390// Parse,
391// Peek,
392// ToSpan,
393// ToCursors,
394// DeclarationMetadata,
395// SemanticEq,
396// Debug,
397// Clone,
398// PartialEq,
399// Eq,
400// PartialOrd,
401// Ord,
402// Hash,
403// )]
404// #[declaration_metadata(
405// initial = "0%",
406// applies_to = Elements,
407// percentages = BackgroundPositioningArea,
408// animation_type = RepeatableList,
409// property_group = Backgrounds,
410// computed_value_type = Unknown,
411// canonical_order = "per grammar",
412// logical_property_group = BackgroundPosition,
413// )]
414// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
415// #[cfg_attr(
416// feature = "css_feature_data",
417// derive(ToCSSFeature),
418// css_feature("css.properties.background-position-y")
419// )]
420// #[cfg_attr(feature = "visitable", derive(Visitable), visit)]
421// pub struct BackgroundPositionYStyleValue<'a>;
422
423/// Represents the style value for `background-repeat` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-repeat).
424///
425/// The background-repeat CSS property sets how a background image is tiled.
426///
427/// The grammar is defined as:
428///
429/// ```text,ignore
430/// <repeat-style>#
431/// ```
432///
433/// https://drafts.csswg.org/css-backgrounds-4/#background-repeat
434#[syntax(" <repeat-style># ")]
435#[derive(
436 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
437)]
438#[declaration_metadata(
439 initial = "repeat",
440 applies_to = Elements,
441 animation_type = Discrete,
442 property_group = Backgrounds,
443 computed_value_type = Unknown,
444 canonical_order = "per grammar",
445)]
446#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
447#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-repeat"))]
448#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
449pub struct BackgroundRepeatStyleValue<'a>;
450
451/// Represents the style value for `background-repeat-block` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-repeat-block).
452///
453/// The grammar is defined as:
454///
455/// ```text,ignore
456/// <repetition>#
457/// ```
458///
459/// https://drafts.csswg.org/css-backgrounds-4/#background-repeat-block
460#[syntax(" <repetition># ")]
461#[derive(
462 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
463)]
464#[declaration_metadata(
465 initial = "repeat",
466 applies_to = Elements,
467 animation_type = Discrete,
468 property_group = Backgrounds,
469 computed_value_type = AsSpecified,
470 canonical_order = "per grammar",
471 logical_property_group = BackgroundRepeat,
472 box_side = BlockStart|BlockEnd,
473)]
474#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
475#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-repeat-block"))]
476#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
477pub struct BackgroundRepeatBlockStyleValue<'a>;
478
479/// Represents the style value for `background-repeat-inline` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-repeat-inline).
480///
481/// The grammar is defined as:
482///
483/// ```text,ignore
484/// <repetition>#
485/// ```
486///
487/// https://drafts.csswg.org/css-backgrounds-4/#background-repeat-inline
488#[syntax(" <repetition># ")]
489#[derive(
490 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
491)]
492#[declaration_metadata(
493 initial = "repeat",
494 applies_to = Elements,
495 animation_type = Discrete,
496 property_group = Backgrounds,
497 computed_value_type = AsSpecified,
498 canonical_order = "per grammar",
499 logical_property_group = BackgroundRepeat,
500 box_side = InlineStart|InlineEnd,
501)]
502#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
503#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-repeat-inline"))]
504#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
505pub struct BackgroundRepeatInlineStyleValue<'a>;
506
507/// Represents the style value for `background-repeat-x` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-repeat-x).
508///
509/// The grammar is defined as:
510///
511/// ```text,ignore
512/// <repetition>#
513/// ```
514///
515/// https://drafts.csswg.org/css-backgrounds-4/#background-repeat-x
516#[syntax(" <repetition># ")]
517#[derive(
518 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
519)]
520#[declaration_metadata(
521 initial = "repeat",
522 applies_to = Elements,
523 animation_type = Discrete,
524 property_group = Backgrounds,
525 computed_value_type = AsSpecified,
526 canonical_order = "per grammar",
527 logical_property_group = BackgroundRepeat,
528)]
529#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
530#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-repeat-x"))]
531#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
532pub struct BackgroundRepeatXStyleValue<'a>;
533
534/// Represents the style value for `background-repeat-y` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-repeat-y).
535///
536/// The grammar is defined as:
537///
538/// ```text,ignore
539/// <repetition>#
540/// ```
541///
542/// https://drafts.csswg.org/css-backgrounds-4/#background-repeat-y
543#[syntax(" <repetition># ")]
544#[derive(
545 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
546)]
547#[declaration_metadata(
548 initial = "repeat",
549 applies_to = Elements,
550 animation_type = Discrete,
551 property_group = Backgrounds,
552 computed_value_type = AsSpecified,
553 canonical_order = "per grammar",
554 logical_property_group = BackgroundRepeat,
555)]
556#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
557#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-repeat-y"))]
558#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
559pub struct BackgroundRepeatYStyleValue<'a>;
560
561/// Represents the style value for `background-size` as defined in [css-backgrounds-4](https://drafts.csswg.org/css-backgrounds-4/#background-size).
562///
563/// The background-size CSS property scales or stretches a background based on the size of the element (with the contain and cover keywords), a length, or percentage.
564///
565/// The grammar is defined as:
566///
567/// ```text,ignore
568/// <bg-size>#
569/// ```
570///
571/// https://drafts.csswg.org/css-backgrounds-4/#background-size
572#[syntax(" <bg-size># ")]
573#[derive(
574 Parse, Peek, ToSpan, ToCursors, DeclarationMetadata, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
575)]
576#[declaration_metadata(
577 initial = "auto",
578 applies_to = Elements,
579 percentages = Unknown,
580 animation_type = RepeatableList,
581 property_group = Backgrounds,
582 computed_value_type = Unknown,
583 canonical_order = "per grammar",
584)]
585#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
586#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.background-size"))]
587#[cfg_attr(feature = "visitable", derive(Visitable), visit)]
588pub struct BackgroundSizeStyleValue<'a>;