css_ast/values/writing_modes/
mod.rs

1#![allow(warnings)]
2//! CSS Writing Modes Level 4
3//! https://drafts.csswg.org/css-writing-modes-4/
4
5mod impls;
6use impls::*;
7
8/// Represents the style value for `direction` as defined in [css-writing-modes-4](https://drafts.csswg.org/css-writing-modes-4/#direction).
9///
10/// The unicode-bidi and direction CSS properties override the Unicode layout algorithm. They are intended for Document Type Definition (DTD) designers. For HTML documents, you should use the dir global HTML attribute and <bdo> HTML element instead.
11///
12/// The grammar is defined as:
13///
14/// ```text,ignore
15/// ltr | rtl
16/// ```
17///
18// https://drafts.csswg.org/css-writing-modes-4/#direction
19#[syntax(" ltr | rtl ")]
20#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21#[style_value(
22	initial = "ltr",
23	applies_to = "all elements",
24	inherited = "yes",
25	percentages = "n/a",
26	canonical_order = "n/a",
27	animation_type = "not animatable"
28)]
29#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.direction"))]
31#[visit]
32pub enum DirectionStyleValue {}
33
34/// Represents the style value for `unicode-bidi` as defined in [css-writing-modes-4](https://drafts.csswg.org/css-writing-modes-4/#unicode-bidi).
35///
36/// The unicode-bidi and direction CSS properties override the Unicode layout algorithm. They are intended for Document Type Definition (DTD) designers. For HTML documents, you should use the dir global HTML attribute and <bdo> HTML element instead.
37///
38/// The grammar is defined as:
39///
40/// ```text,ignore
41/// normal | embed | isolate | bidi-override | isolate-override | plaintext
42/// ```
43///
44// https://drafts.csswg.org/css-writing-modes-4/#unicode-bidi
45#[syntax(" normal | embed | isolate | bidi-override | isolate-override | plaintext ")]
46#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
47#[style_value(
48	initial = "normal",
49	applies_to = "all elements, but see prose",
50	inherited = "no",
51	percentages = "n/a",
52	canonical_order = "per grammar",
53	animation_type = "not animatable"
54)]
55#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
56#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.unicode-bidi"))]
57#[visit]
58pub enum UnicodeBidiStyleValue {}
59
60/// Represents the style value for `writing-mode` as defined in [css-writing-modes-4](https://drafts.csswg.org/css-writing-modes-4/#writing-mode).
61///
62/// The writing-mode CSS property sets whether text is laid out horizontally or vertically, and left to right, or right to left.
63///
64/// The grammar is defined as:
65///
66/// ```text,ignore
67/// horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr
68/// ```
69///
70// https://drafts.csswg.org/css-writing-modes-4/#writing-mode
71#[syntax(" horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr ")]
72#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
73#[style_value(
74	initial = "horizontal-tb",
75	applies_to = "All elements except table row groups, table column groups, table rows, table columns, ruby base containers, ruby annotation containers",
76	inherited = "yes",
77	percentages = "n/a",
78	canonical_order = "n/a",
79	animation_type = "not animatable"
80)]
81#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
82#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.writing-mode"))]
83#[visit]
84pub enum WritingModeStyleValue {}
85
86/// Represents the style value for `text-orientation` as defined in [css-writing-modes-4](https://drafts.csswg.org/css-writing-modes-4/#text-orientation).
87///
88/// The text-orientation CSS property sets the how text is typeset within a line when the writing mode is vertical.
89///
90/// The grammar is defined as:
91///
92/// ```text,ignore
93/// mixed | upright | sideways
94/// ```
95///
96// https://drafts.csswg.org/css-writing-modes-4/#text-orientation
97#[syntax(" mixed | upright | sideways ")]
98#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
99#[style_value(
100	initial = "mixed",
101	applies_to = "all elements except table row groups, rows, column groups, and columns; and text",
102	inherited = "yes",
103	percentages = "n/a",
104	canonical_order = "n/a",
105	animation_type = "not animatable"
106)]
107#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
108#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.text-orientation"))]
109#[visit]
110pub enum TextOrientationStyleValue {}
111
112/// Represents the style value for `glyph-orientation-vertical` as defined in [css-writing-modes-4](https://drafts.csswg.org/css-writing-modes-4/#glyph-orientation-vertical).
113///
114/// The glyph-orientation-vertical CSS property sets the orientation of glyphs in text rendered in a vertical writing mode.
115///
116/// The grammar is defined as:
117///
118/// ```text,ignore
119/// auto | 0deg | 90deg | 0 | 90
120/// ```
121///
122// https://drafts.csswg.org/css-writing-modes-4/#glyph-orientation-vertical
123#[syntax(" auto | 0deg | 90deg | 0 | 90 ")]
124#[derive(Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
125#[style_value(
126	initial = "n/a",
127	applies_to = "n/a",
128	inherited = "n/a",
129	percentages = "n/a",
130	canonical_order = "n/a",
131	animation_type = "n/a"
132)]
133#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
134#[cfg_attr(
135	feature = "css_feature_data",
136	derive(ToCSSFeature),
137	css_feature("css.properties.glyph-orientation-vertical")
138)]
139#[visit]
140pub enum GlyphOrientationVerticalStyleValue {}
141
142/// Represents the style value for `text-combine-upright` as defined in [css-writing-modes-4](https://drafts.csswg.org/css-writing-modes-4/#text-combine-upright).
143///
144/// The text-combine-upright CSS property displays multiple characters in the space of a single character in vertical text. This is used in East Asian documents to display Latin-based strings such as components of a date or letters of an initialism.
145///
146/// The grammar is defined as:
147///
148/// ```text,ignore
149/// none | all | [ digits <integer [2,4]>? ]
150/// ```
151///
152// https://drafts.csswg.org/css-writing-modes-4/#text-combine-upright
153#[syntax(" none | all | [ digits <integer [2,4]>? ] ")]
154#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
155#[style_value(
156	initial = "none",
157	applies_to = "inline boxes and text",
158	inherited = "yes",
159	percentages = "n/a",
160	canonical_order = "n/a",
161	animation_type = "not animatable"
162)]
163#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
164#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.text-combine-upright"))]
165#[visit]
166pub enum TextCombineUprightStyleValue {}