Skip to main content

azul_css/props/
macros.rs

1//! Internal macros for reducing boilerplate in property definitions.
2
3/// Creates `pt`, `px` and `em` constructors for any struct that has a
4/// `PixelValue` as it's self.0 field.
5macro_rules! impl_pixel_value {
6    ($struct:ident) => {
7        impl $struct {
8            #[inline]
9            pub const fn zero() -> Self {
10                Self {
11                    inner: crate::props::basic::pixel::PixelValue::zero(),
12                }
13            }
14
15            #[inline]
16            pub const fn const_px(value: isize) -> Self {
17                Self {
18                    inner: crate::props::basic::pixel::PixelValue::const_px(value),
19                }
20            }
21
22            #[inline]
23            pub const fn const_em(value: isize) -> Self {
24                Self {
25                    inner: crate::props::basic::pixel::PixelValue::const_em(value),
26                }
27            }
28
29            #[inline]
30            pub const fn const_pt(value: isize) -> Self {
31                Self {
32                    inner: crate::props::basic::pixel::PixelValue::const_pt(value),
33                }
34            }
35
36            #[inline]
37            pub const fn const_percent(value: isize) -> Self {
38                Self {
39                    inner: crate::props::basic::pixel::PixelValue::const_percent(value),
40                }
41            }
42
43            #[inline]
44            pub const fn const_in(value: isize) -> Self {
45                Self {
46                    inner: crate::props::basic::pixel::PixelValue::const_in(value),
47                }
48            }
49
50            #[inline]
51            pub const fn const_cm(value: isize) -> Self {
52                Self {
53                    inner: crate::props::basic::pixel::PixelValue::const_cm(value),
54                }
55            }
56
57            #[inline]
58            pub const fn const_mm(value: isize) -> Self {
59                Self {
60                    inner: crate::props::basic::pixel::PixelValue::const_mm(value),
61                }
62            }
63
64            #[inline]
65            pub const fn const_from_metric(
66                metric: crate::props::basic::length::SizeMetric,
67                value: isize,
68            ) -> Self {
69                Self {
70                    inner: crate::props::basic::pixel::PixelValue::const_from_metric(metric, value),
71                }
72            }
73
74            #[inline]
75            pub fn px(value: f32) -> Self {
76                Self {
77                    inner: crate::props::basic::pixel::PixelValue::px(value),
78                }
79            }
80
81            #[inline]
82            pub fn em(value: f32) -> Self {
83                Self {
84                    inner: crate::props::basic::pixel::PixelValue::em(value),
85                }
86            }
87
88            #[inline]
89            pub fn pt(value: f32) -> Self {
90                Self {
91                    inner: crate::props::basic::pixel::PixelValue::pt(value),
92                }
93            }
94
95            #[inline]
96            pub fn percent(value: f32) -> Self {
97                Self {
98                    inner: crate::props::basic::pixel::PixelValue::percent(value),
99                }
100            }
101
102            #[inline]
103            pub fn from_metric(
104                metric: crate::props::basic::length::SizeMetric,
105                value: f32,
106            ) -> Self {
107                Self {
108                    inner: crate::props::basic::pixel::PixelValue::from_metric(metric, value),
109                }
110            }
111
112            #[inline]
113            pub fn interpolate(&self, other: &Self, t: f32) -> Self {
114                $struct {
115                    inner: self.inner.interpolate(&other.inner, t),
116                }
117            }
118        }
119    };
120}
121
122macro_rules! impl_percentage_value {
123    ($struct:ident) => {
124        impl ::core::fmt::Display for $struct {
125            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
126                write!(f, "{}%", self.inner.normalized() * 100.0)
127            }
128        }
129
130        impl ::core::fmt::Debug for $struct {
131            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
132                write!(f, "{}%", self.inner.normalized() * 100.0)
133            }
134        }
135
136        impl $struct {
137            /// Same as `PercentageValue::new()`, but only accepts whole numbers,
138            /// since using `f32` in const fn is not yet stabilized.
139            #[inline]
140            pub const fn const_new(value: isize) -> Self {
141                Self {
142                    inner: PercentageValue::const_new(value),
143                }
144            }
145
146            #[inline]
147            pub fn new(value: f32) -> Self {
148                Self {
149                    inner: PercentageValue::new(value),
150                }
151            }
152
153            #[inline]
154            pub fn interpolate(&self, other: &Self, t: f32) -> Self {
155                $struct {
156                    inner: self.inner.interpolate(&other.inner, t),
157                }
158            }
159        }
160    };
161}
162
163macro_rules! impl_float_value {
164    ($struct:ident) => {
165        impl $struct {
166            /// Same as `FloatValue::new()`, but only accepts whole numbers,
167            /// since using `f32` in const fn is not yet stabilized.
168            pub const fn const_new(value: isize) -> Self {
169                Self {
170                    inner: FloatValue::const_new(value),
171                }
172            }
173
174            pub fn new(value: f32) -> Self {
175                Self {
176                    inner: FloatValue::new(value),
177                }
178            }
179
180            pub fn get(&self) -> f32 {
181                self.inner.get()
182            }
183
184            #[inline]
185            pub fn interpolate(&self, other: &Self, t: f32) -> Self {
186                Self {
187                    inner: self.inner.interpolate(&other.inner, t),
188                }
189            }
190        }
191
192        impl From<f32> for $struct {
193            fn from(val: f32) -> Self {
194                Self {
195                    inner: FloatValue::from(val),
196                }
197            }
198        }
199
200        impl ::core::fmt::Display for $struct {
201            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
202                write!(f, "{}", self.inner.get())
203            }
204        }
205
206        impl ::core::fmt::Debug for $struct {
207            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
208                write!(f, "{}", self.inner.get())
209            }
210        }
211    };
212}
213
214/// Trait to allow `define_dimension_property!` to work.
215pub trait PixelValueTaker {
216    fn from_pixel_value(inner: crate::props::basic::pixel::PixelValue) -> Self;
217}
218
219/// A parser that can accept a list of items and mappings
220macro_rules! multi_type_parser {
221    ($fn:ident, $return_str:expr, $return:ident, $import_str:expr, $([$identifier_string:expr, $enum_type:ident, $parse_str:expr]),+) => {
222        #[doc = "Parses a `"]
223        #[doc = $return_str]
224        #[doc = "` attribute from a `&str`"]
225        #[doc = ""]
226        #[doc = "# Example"]
227        #[doc = ""]
228        #[doc = "```rust"]
229        #[doc = $import_str]
230        $(
231            #[doc = $parse_str]
232        )+
233        #[doc = "```"]
234        pub fn $fn<'a>(input: &'a str)
235        -> Result<$return, InvalidValueErr<'a>>
236        {
237            let input = input.trim();
238            match input {
239                $(
240                    $identifier_string => Ok($return::$enum_type),
241                )+
242                _ => Err(InvalidValueErr(input)),
243            }
244        }
245
246        impl FormatAsCssValue for $return {
247            fn format_as_css_value(&self, f: &mut fmt::Formatter) -> fmt::Result {
248                match self {
249                    $(
250                        $return::$enum_type => write!(f, $identifier_string),
251                    )+
252                }
253            }
254        }
255    };
256    ($fn:ident, $return:ident, $([$identifier_string:expr, $enum_type:ident]),+) => {
257        multi_type_parser!($fn, stringify!($return), $return,
258            concat!(
259                "# extern crate azul_css;", "\r\n",
260                "# use azul_css::parser2::", stringify!($fn), ";", "\r\n",
261                "# use azul_css::", stringify!($return), ";"
262            ),
263            $([
264                $identifier_string, $enum_type,
265                concat!(
266                    "assert_eq!(",
267                    stringify!($fn),
268                    "(\"",
269                    $identifier_string,
270                    "\"), Ok(",
271                    stringify!($return),
272                    "::",
273                    stringify!($enum_type),
274                    "));"
275                )
276            ]),+
277        );
278    };
279}
280
281macro_rules! css_property_from_type {
282    ($prop_type:expr, $content_type:ident) => {{
283        match $prop_type {
284            CssPropertyType::CaretColor => CssProperty::CaretColor(CssPropertyValue::$content_type),
285            CssPropertyType::CaretWidth => CssProperty::CaretWidth(CssPropertyValue::$content_type),
286            CssPropertyType::CaretAnimationDuration => {
287                CssProperty::CaretAnimationDuration(CssPropertyValue::$content_type)
288            }
289            CssPropertyType::SelectionBackgroundColor => {
290                CssProperty::SelectionBackgroundColor(CssPropertyValue::$content_type)
291            }
292            CssPropertyType::SelectionColor => {
293                CssProperty::SelectionColor(CssPropertyValue::$content_type)
294            }
295            CssPropertyType::SelectionRadius => {
296                CssProperty::SelectionRadius(CssPropertyValue::$content_type)
297            }
298
299            CssPropertyType::TextColor => CssProperty::TextColor(CssPropertyValue::$content_type),
300            CssPropertyType::FontSize => CssProperty::FontSize(CssPropertyValue::$content_type),
301            CssPropertyType::FontFamily => CssProperty::FontFamily(CssPropertyValue::$content_type),
302            CssPropertyType::TextAlign => CssProperty::TextAlign(CssPropertyValue::$content_type),
303            CssPropertyType::VerticalAlign => {
304                CssProperty::VerticalAlign(CssPropertyValue::$content_type)
305            }
306            CssPropertyType::LetterSpacing => {
307                CssProperty::LetterSpacing(CssPropertyValue::$content_type)
308            }
309            CssPropertyType::TextIndent => CssProperty::TextIndent(CssPropertyValue::$content_type),
310            CssPropertyType::InitialLetter => {
311                CssProperty::InitialLetter(CssPropertyValue::$content_type)
312            }
313            CssPropertyType::LineClamp => CssProperty::LineClamp(CssPropertyValue::$content_type),
314            CssPropertyType::HangingPunctuation => {
315                CssProperty::HangingPunctuation(CssPropertyValue::$content_type)
316            }
317            CssPropertyType::TextCombineUpright => {
318                CssProperty::TextCombineUpright(CssPropertyValue::$content_type)
319            }
320            CssPropertyType::ExclusionMargin => {
321                CssProperty::ExclusionMargin(CssPropertyValue::$content_type)
322            }
323            CssPropertyType::HyphenationLanguage => {
324                CssProperty::HyphenationLanguage(CssPropertyValue::$content_type)
325            }
326            CssPropertyType::LineHeight => CssProperty::LineHeight(CssPropertyValue::$content_type),
327            CssPropertyType::WordSpacing => {
328                CssProperty::WordSpacing(CssPropertyValue::$content_type)
329            }
330            CssPropertyType::TabSize => CssProperty::TabSize(CssPropertyValue::$content_type),
331            CssPropertyType::Cursor => CssProperty::Cursor(CssPropertyValue::$content_type),
332            CssPropertyType::Display => CssProperty::Display(CssPropertyValue::$content_type),
333            CssPropertyType::Float => CssProperty::Float(CssPropertyValue::$content_type),
334            CssPropertyType::BoxSizing => CssProperty::BoxSizing(CssPropertyValue::$content_type),
335            CssPropertyType::Width => CssProperty::Width(CssPropertyValue::$content_type),
336            CssPropertyType::Height => CssProperty::Height(CssPropertyValue::$content_type),
337            CssPropertyType::MinWidth => CssProperty::MinWidth(CssPropertyValue::$content_type),
338            CssPropertyType::MinHeight => CssProperty::MinHeight(CssPropertyValue::$content_type),
339            CssPropertyType::MaxWidth => CssProperty::MaxWidth(CssPropertyValue::$content_type),
340            CssPropertyType::MaxHeight => CssProperty::MaxHeight(CssPropertyValue::$content_type),
341            CssPropertyType::Position => CssProperty::Position(CssPropertyValue::$content_type),
342            CssPropertyType::Top => CssProperty::Top(CssPropertyValue::$content_type),
343            CssPropertyType::Right => CssProperty::Right(CssPropertyValue::$content_type),
344            CssPropertyType::Left => CssProperty::Left(CssPropertyValue::$content_type),
345            CssPropertyType::Bottom => CssProperty::Bottom(CssPropertyValue::$content_type),
346            CssPropertyType::ZIndex => CssProperty::ZIndex(CssPropertyValue::$content_type),
347            CssPropertyType::FlexWrap => CssProperty::FlexWrap(CssPropertyValue::$content_type),
348            CssPropertyType::FlexDirection => {
349                CssProperty::FlexDirection(CssPropertyValue::$content_type)
350            }
351            CssPropertyType::FlexGrow => CssProperty::FlexGrow(CssPropertyValue::$content_type),
352            CssPropertyType::FlexShrink => CssProperty::FlexShrink(CssPropertyValue::$content_type),
353            CssPropertyType::FlexBasis => CssProperty::FlexBasis(CssPropertyValue::$content_type),
354            CssPropertyType::JustifyContent => {
355                CssProperty::JustifyContent(CssPropertyValue::$content_type)
356            }
357            CssPropertyType::AlignItems => CssProperty::AlignItems(CssPropertyValue::$content_type),
358            CssPropertyType::AlignContent => {
359                CssProperty::AlignContent(CssPropertyValue::$content_type)
360            }
361            CssPropertyType::ColumnGap => CssProperty::ColumnGap(CssPropertyValue::$content_type),
362            CssPropertyType::RowGap => CssProperty::RowGap(CssPropertyValue::$content_type),
363            CssPropertyType::GridTemplateColumns => {
364                CssProperty::GridTemplateColumns(CssPropertyValue::$content_type)
365            }
366            CssPropertyType::GridTemplateRows => {
367                CssProperty::GridTemplateRows(CssPropertyValue::$content_type)
368            }
369            CssPropertyType::GridAutoColumns => {
370                CssProperty::GridAutoColumns(CssPropertyValue::$content_type)
371            }
372            CssPropertyType::GridAutoFlow => {
373                CssProperty::GridAutoFlow(CssPropertyValue::$content_type)
374            }
375            CssPropertyType::JustifySelf => {
376                CssProperty::JustifySelf(CssPropertyValue::$content_type)
377            }
378            CssPropertyType::JustifyItems => {
379                CssProperty::JustifyItems(CssPropertyValue::$content_type)
380            }
381            CssPropertyType::Gap => CssProperty::Gap(CssPropertyValue::$content_type),
382            CssPropertyType::GridGap => CssProperty::GridGap(CssPropertyValue::$content_type),
383            CssPropertyType::AlignSelf => CssProperty::AlignSelf(CssPropertyValue::$content_type),
384            CssPropertyType::Font => CssProperty::Font(CssPropertyValue::$content_type),
385            CssPropertyType::GridAutoRows => {
386                CssProperty::GridAutoRows(CssPropertyValue::$content_type)
387            }
388            CssPropertyType::GridColumn => CssProperty::GridColumn(CssPropertyValue::$content_type),
389            CssPropertyType::GridRow => CssProperty::GridRow(CssPropertyValue::$content_type),
390            CssPropertyType::GridTemplateAreas => {
391                CssProperty::GridTemplateAreas(CssPropertyValue::$content_type)
392            }
393            CssPropertyType::WritingMode => {
394                CssProperty::WritingMode(CssPropertyValue::$content_type)
395            }
396            CssPropertyType::Clear => CssProperty::Clear(CssPropertyValue::$content_type),
397            CssPropertyType::OverflowX => CssProperty::OverflowX(CssPropertyValue::$content_type),
398            CssPropertyType::OverflowY => CssProperty::OverflowY(CssPropertyValue::$content_type),
399            CssPropertyType::PaddingTop => CssProperty::PaddingTop(CssPropertyValue::$content_type),
400            CssPropertyType::PaddingLeft => {
401                CssProperty::PaddingLeft(CssPropertyValue::$content_type)
402            }
403            CssPropertyType::PaddingRight => {
404                CssProperty::PaddingRight(CssPropertyValue::$content_type)
405            }
406            CssPropertyType::PaddingBottom => {
407                CssProperty::PaddingBottom(CssPropertyValue::$content_type)
408            }
409            CssPropertyType::PaddingInlineStart => {
410                CssProperty::PaddingInlineStart(CssPropertyValue::$content_type)
411            }
412            CssPropertyType::PaddingInlineEnd => {
413                CssProperty::PaddingInlineEnd(CssPropertyValue::$content_type)
414            }
415            CssPropertyType::MarginTop => CssProperty::MarginTop(CssPropertyValue::$content_type),
416            CssPropertyType::MarginLeft => CssProperty::MarginLeft(CssPropertyValue::$content_type),
417            CssPropertyType::MarginRight => {
418                CssProperty::MarginRight(CssPropertyValue::$content_type)
419            }
420            CssPropertyType::MarginBottom => {
421                CssProperty::MarginBottom(CssPropertyValue::$content_type)
422            }
423            CssPropertyType::BackgroundContent => {
424                CssProperty::BackgroundContent(CssPropertyValue::$content_type)
425            }
426            CssPropertyType::BackgroundPosition => {
427                CssProperty::BackgroundPosition(CssPropertyValue::$content_type)
428            }
429            CssPropertyType::BackgroundSize => {
430                CssProperty::BackgroundSize(CssPropertyValue::$content_type)
431            }
432            CssPropertyType::BackgroundRepeat => {
433                CssProperty::BackgroundRepeat(CssPropertyValue::$content_type)
434            }
435            CssPropertyType::BorderTopLeftRadius => {
436                CssProperty::BorderTopLeftRadius(CssPropertyValue::$content_type)
437            }
438            CssPropertyType::BorderTopRightRadius => {
439                CssProperty::BorderTopRightRadius(CssPropertyValue::$content_type)
440            }
441            CssPropertyType::BorderBottomLeftRadius => {
442                CssProperty::BorderBottomLeftRadius(CssPropertyValue::$content_type)
443            }
444            CssPropertyType::BorderBottomRightRadius => {
445                CssProperty::BorderBottomRightRadius(CssPropertyValue::$content_type)
446            }
447            CssPropertyType::BorderTopColor => {
448                CssProperty::BorderTopColor(CssPropertyValue::$content_type)
449            }
450            CssPropertyType::BorderRightColor => {
451                CssProperty::BorderRightColor(CssPropertyValue::$content_type)
452            }
453            CssPropertyType::BorderLeftColor => {
454                CssProperty::BorderLeftColor(CssPropertyValue::$content_type)
455            }
456            CssPropertyType::BorderBottomColor => {
457                CssProperty::BorderBottomColor(CssPropertyValue::$content_type)
458            }
459            CssPropertyType::BorderTopStyle => {
460                CssProperty::BorderTopStyle(CssPropertyValue::$content_type)
461            }
462            CssPropertyType::BorderRightStyle => {
463                CssProperty::BorderRightStyle(CssPropertyValue::$content_type)
464            }
465            CssPropertyType::BorderLeftStyle => {
466                CssProperty::BorderLeftStyle(CssPropertyValue::$content_type)
467            }
468            CssPropertyType::BorderBottomStyle => {
469                CssProperty::BorderBottomStyle(CssPropertyValue::$content_type)
470            }
471            CssPropertyType::BorderTopWidth => {
472                CssProperty::BorderTopWidth(CssPropertyValue::$content_type)
473            }
474            CssPropertyType::BorderRightWidth => {
475                CssProperty::BorderRightWidth(CssPropertyValue::$content_type)
476            }
477            CssPropertyType::BorderLeftWidth => {
478                CssProperty::BorderLeftWidth(CssPropertyValue::$content_type)
479            }
480            CssPropertyType::BorderBottomWidth => {
481                CssProperty::BorderBottomWidth(CssPropertyValue::$content_type)
482            }
483            CssPropertyType::BoxShadowLeft => {
484                CssProperty::BoxShadowLeft(CssPropertyValue::$content_type)
485            }
486            CssPropertyType::BoxShadowRight => {
487                CssProperty::BoxShadowRight(CssPropertyValue::$content_type)
488            }
489            CssPropertyType::BoxShadowTop => {
490                CssProperty::BoxShadowTop(CssPropertyValue::$content_type)
491            }
492            CssPropertyType::BoxShadowBottom => {
493                CssProperty::BoxShadowBottom(CssPropertyValue::$content_type)
494            }
495            CssPropertyType::Scrollbar => CssProperty::Scrollbar(CssPropertyValue::$content_type),
496            CssPropertyType::ScrollbarWidth => {
497                CssProperty::ScrollbarWidth(CssPropertyValue::$content_type)
498            }
499            CssPropertyType::ScrollbarColor => {
500                CssProperty::ScrollbarColor(CssPropertyValue::$content_type)
501            }
502            CssPropertyType::Opacity => CssProperty::Opacity(CssPropertyValue::$content_type),
503            CssPropertyType::Visibility => CssProperty::Visibility(CssPropertyValue::$content_type),
504            CssPropertyType::Transform => CssProperty::Transform(CssPropertyValue::$content_type),
505            CssPropertyType::PerspectiveOrigin => {
506                CssProperty::PerspectiveOrigin(CssPropertyValue::$content_type)
507            }
508            CssPropertyType::TransformOrigin => {
509                CssProperty::TransformOrigin(CssPropertyValue::$content_type)
510            }
511            CssPropertyType::BackfaceVisibility => {
512                CssProperty::BackfaceVisibility(CssPropertyValue::$content_type)
513            }
514            CssPropertyType::MixBlendMode => {
515                CssProperty::MixBlendMode(CssPropertyValue::$content_type)
516            }
517            CssPropertyType::Filter => CssProperty::Filter(CssPropertyValue::$content_type),
518            CssPropertyType::BackdropFilter => {
519                CssProperty::BackdropFilter(CssPropertyValue::$content_type)
520            }
521            CssPropertyType::TextShadow => CssProperty::TextShadow(CssPropertyValue::$content_type),
522            CssPropertyType::Direction => CssProperty::Direction(CssPropertyValue::$content_type),
523            CssPropertyType::Hyphens => CssProperty::Hyphens(CssPropertyValue::$content_type),
524            CssPropertyType::WhiteSpace => CssProperty::WhiteSpace(CssPropertyValue::$content_type),
525            CssPropertyType::UserSelect => CssProperty::UserSelect(CssPropertyValue::$content_type),
526            CssPropertyType::TextDecoration => {
527                CssProperty::TextDecoration(CssPropertyValue::$content_type)
528            }
529            // Fragmentation / Columns / Flow / Shape / Content
530            CssPropertyType::TextJustify => {
531                CssProperty::LayoutTextJustify(CssPropertyValue::$content_type)
532            }
533            CssPropertyType::BreakBefore => {
534                CssProperty::BreakBefore(CssPropertyValue::$content_type)
535            }
536            CssPropertyType::BreakAfter => CssProperty::BreakAfter(CssPropertyValue::$content_type),
537            CssPropertyType::BreakInside => {
538                CssProperty::BreakInside(CssPropertyValue::$content_type)
539            }
540            CssPropertyType::Widows => CssProperty::Widows(CssPropertyValue::$content_type),
541            CssPropertyType::Orphans => CssProperty::Orphans(CssPropertyValue::$content_type),
542            CssPropertyType::BoxDecorationBreak => {
543                CssProperty::BoxDecorationBreak(CssPropertyValue::$content_type)
544            }
545            CssPropertyType::ColumnCount => {
546                CssProperty::ColumnCount(CssPropertyValue::$content_type)
547            }
548            CssPropertyType::ColumnWidth => {
549                CssProperty::ColumnWidth(CssPropertyValue::$content_type)
550            }
551            CssPropertyType::ColumnSpan => CssProperty::ColumnSpan(CssPropertyValue::$content_type),
552            CssPropertyType::ColumnFill => CssProperty::ColumnFill(CssPropertyValue::$content_type),
553            CssPropertyType::ColumnRuleWidth => {
554                CssProperty::ColumnRuleWidth(CssPropertyValue::$content_type)
555            }
556            CssPropertyType::ColumnRuleStyle => {
557                CssProperty::ColumnRuleStyle(CssPropertyValue::$content_type)
558            }
559            CssPropertyType::ColumnRuleColor => {
560                CssProperty::ColumnRuleColor(CssPropertyValue::$content_type)
561            }
562            CssPropertyType::FlowInto => CssProperty::FlowInto(CssPropertyValue::$content_type),
563            CssPropertyType::FlowFrom => CssProperty::FlowFrom(CssPropertyValue::$content_type),
564            CssPropertyType::ShapeOutside => {
565                CssProperty::ShapeOutside(CssPropertyValue::$content_type)
566            }
567            CssPropertyType::ShapeInside => {
568                CssProperty::ShapeInside(CssPropertyValue::$content_type)
569            }
570            CssPropertyType::ClipPath => CssProperty::ClipPath(CssPropertyValue::$content_type),
571            CssPropertyType::ShapeMargin => {
572                CssProperty::ShapeMargin(CssPropertyValue::$content_type)
573            }
574            CssPropertyType::ShapeImageThreshold => {
575                CssProperty::ShapeImageThreshold(CssPropertyValue::$content_type)
576            }
577            CssPropertyType::Content => CssProperty::Content(CssPropertyValue::$content_type),
578            CssPropertyType::CounterReset => {
579                CssProperty::CounterReset(CssPropertyValue::$content_type)
580            }
581            CssPropertyType::CounterIncrement => {
582                CssProperty::CounterIncrement(CssPropertyValue::$content_type)
583            }
584            CssPropertyType::ListStyleType => {
585                CssProperty::ListStyleType(CssPropertyValue::$content_type)
586            }
587            CssPropertyType::ListStylePosition => {
588                CssProperty::ListStylePosition(CssPropertyValue::$content_type)
589            }
590            CssPropertyType::StringSet => CssProperty::StringSet(CssPropertyValue::$content_type),
591            CssPropertyType::TableLayout => {
592                CssProperty::TableLayout(CssPropertyValue::$content_type)
593            }
594            CssPropertyType::BorderCollapse => {
595                CssProperty::BorderCollapse(CssPropertyValue::$content_type)
596            }
597            CssPropertyType::BorderSpacing => {
598                CssProperty::BorderSpacing(CssPropertyValue::$content_type)
599            }
600            CssPropertyType::CaptionSide => {
601                CssProperty::CaptionSide(CssPropertyValue::$content_type)
602            }
603            CssPropertyType::EmptyCells => CssProperty::EmptyCells(CssPropertyValue::$content_type),
604            CssPropertyType::FontWeight => CssProperty::FontWeight(CssPropertyValue::$content_type),
605            CssPropertyType::FontStyle => CssProperty::FontStyle(CssPropertyValue::$content_type),
606        }
607    }};
608}