css_ast/values/ruby/mod.rs
1#![allow(warnings)]
2//! CSS Ruby Annotation Layout Module Level 1
3//! https://drafts.csswg.org/css-ruby-1/
4
5mod impls;
6use impls::*;
7
8// /// Represents the style value for `ruby-position` as defined in [css-ruby-1](https://drafts.csswg.org/css-ruby-1/#ruby-position).
9// ///
10// /// The ruby-position CSS property sets the position of a ruby annotation in relation to its base text. Annotations can display over, under, or interleaved with the base text.
11// ///
12// /// The grammar is defined as:
13// ///
14// /// ```text,ignore
15// /// [ alternate || [ over | under ] ] | inter-character
16// /// ```
17// ///
18// // https://drafts.csswg.org/css-ruby-1/#ruby-position
19// #[syntax(" [ alternate || [ over | under ] ] | inter-character ")]
20// #[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21// #[style_value(
22// initial = "alternate",
23// applies_to = "ruby annotation containers",
24// inherited = "yes",
25// percentages = "n/a",
26// canonical_order = "per grammar",
27// animation_type = "discrete",
28// )]
29// #[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
30// #[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.ruby-position"))]
31// #[visit]
32// pub enum RubyPositionStyleValue {}
33
34/// Represents the style value for `ruby-merge` as defined in [css-ruby-1](https://drafts.csswg.org/css-ruby-1/#ruby-merge).
35///
36/// The grammar is defined as:
37///
38/// ```text,ignore
39/// separate | merge | auto
40/// ```
41///
42// https://drafts.csswg.org/css-ruby-1/#ruby-merge
43#[syntax(" separate | merge | auto ")]
44#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
45#[style_value(
46 initial = "separate",
47 applies_to = "interlinear ruby annotation containers",
48 inherited = "yes",
49 percentages = "n/a",
50 canonical_order = "per grammar",
51 animation_type = "by computed value type"
52)]
53#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
54#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.ruby-merge"))]
55#[visit]
56pub enum RubyMergeStyleValue {}
57
58/// Represents the style value for `ruby-align` as defined in [css-ruby-1](https://drafts.csswg.org/css-ruby-1/#ruby-align).
59///
60/// The ruby-align CSS property sets the spacing and alignment of ruby annotation text when it does not fill its available space.
61///
62/// The grammar is defined as:
63///
64/// ```text,ignore
65/// start | center | space-between | space-around
66/// ```
67///
68// https://drafts.csswg.org/css-ruby-1/#ruby-align
69#[syntax(" start | center | space-between | space-around ")]
70#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
71#[style_value(
72 initial = "space-around",
73 applies_to = "ruby bases, ruby annotations, ruby base containers, ruby annotation containers",
74 inherited = "yes",
75 percentages = "n/a",
76 canonical_order = "per grammar",
77 animation_type = "by computed value type"
78)]
79#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
80#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.ruby-align"))]
81#[visit]
82pub enum RubyAlignStyleValue {}
83
84/// Represents the style value for `ruby-overhang` as defined in [css-ruby-1](https://drafts.csswg.org/css-ruby-1/#ruby-overhang).
85///
86/// The ruby-overhang CSS property sets whether ruby annotations may overlap adjacent text.
87///
88/// The grammar is defined as:
89///
90/// ```text,ignore
91/// auto | none
92/// ```
93///
94// https://drafts.csswg.org/css-ruby-1/#ruby-overhang
95#[syntax(" auto | none ")]
96#[derive(Parse, Peek, ToSpan, ToCursors, StyleValue, Visitable, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
97#[style_value(
98 initial = "auto",
99 applies_to = "ruby annotation containers",
100 inherited = "yes",
101 percentages = "n/a",
102 canonical_order = "per grammar",
103 animation_type = "by computed value type"
104)]
105#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
106#[cfg_attr(feature = "css_feature_data", derive(ToCSSFeature), css_feature("css.properties.ruby-overhang"))]
107#[visit]
108pub enum RubyOverhangStyleValue {}