Skip to main content

css_ast/values/backgrounds/
mod.rs

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