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