azul-css 0.0.8

Common datatypes used for styling applications using the Azul desktop GUI framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
//! Internal macros for reducing boilerplate in property definitions.
//!
//! - `impl_pixel_value!` — adds unit constructors (`px`, `em`, `pt`, …) to structs wrapping `PixelValue`
//! - `impl_percentage_value!` — adds constructors and `Display`/`Debug` impls for percentage wrappers
//! - `css_property_from_type!` — maps `CssPropertyType` variants to `CssProperty` enum values (used by `property.rs`)

/// Creates `pt`, `px` and `em` constructors for any struct that has a
/// `PixelValue` as its `self.inner` field.
macro_rules! impl_pixel_value {
    ($struct:ident) => {
        impl $struct {
            #[inline]
            pub const fn zero() -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::zero(),
                }
            }

            #[inline]
            pub const fn const_px(value: isize) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::const_px(value),
                }
            }

            #[inline]
            pub const fn const_em(value: isize) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::const_em(value),
                }
            }

            #[inline]
            pub const fn const_pt(value: isize) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::const_pt(value),
                }
            }

            #[inline]
            pub const fn const_percent(value: isize) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::const_percent(value),
                }
            }

            #[inline]
            pub const fn const_in(value: isize) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::const_in(value),
                }
            }

            #[inline]
            pub const fn const_cm(value: isize) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::const_cm(value),
                }
            }

            #[inline]
            pub const fn const_mm(value: isize) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::const_mm(value),
                }
            }

            #[inline]
            pub const fn const_from_metric(
                metric: crate::props::basic::length::SizeMetric,
                value: isize,
            ) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::const_from_metric(metric, value),
                }
            }

            #[inline]
            pub fn px(value: f32) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::px(value),
                }
            }

            #[inline]
            pub fn em(value: f32) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::em(value),
                }
            }

            #[inline]
            pub fn pt(value: f32) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::pt(value),
                }
            }

            #[inline]
            pub fn percent(value: f32) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::percent(value),
                }
            }

            #[inline]
            pub fn from_metric(
                metric: crate::props::basic::length::SizeMetric,
                value: f32,
            ) -> Self {
                Self {
                    inner: crate::props::basic::pixel::PixelValue::from_metric(metric, value),
                }
            }

            #[inline]
            pub fn interpolate(&self, other: &Self, t: f32) -> Self {
                $struct {
                    inner: self.inner.interpolate(&other.inner, t),
                }
            }
        }
    };
}

macro_rules! impl_percentage_value {
    ($struct:ident) => {
        impl ::core::fmt::Display for $struct {
            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
                write!(f, "{}%", self.inner.normalized() * 100.0)
            }
        }

        impl ::core::fmt::Debug for $struct {
            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
                write!(f, "{}%", self.inner.normalized() * 100.0)
            }
        }

        impl $struct {
            /// Same as `PercentageValue::new()`, but only accepts whole numbers
            /// in order to be usable in `const` context.
            #[inline]
            pub const fn const_new(value: isize) -> Self {
                Self {
                    inner: PercentageValue::const_new(value),
                }
            }

            #[inline]
            pub fn new(value: f32) -> Self {
                Self {
                    inner: PercentageValue::new(value),
                }
            }

            #[inline]
            pub fn interpolate(&self, other: &Self, t: f32) -> Self {
                $struct {
                    inner: self.inner.interpolate(&other.inner, t),
                }
            }
        }
    };
}

/// Converts a `PixelValue` into a typed dimension wrapper, used by the layout solver.
pub trait PixelValueTaker {
    fn from_pixel_value(inner: crate::props::basic::pixel::PixelValue) -> Self;
}

macro_rules! css_property_from_type {
    ($prop_type:expr, $content_type:ident) => {{
        match $prop_type {
            CssPropertyType::CaretColor => CssProperty::CaretColor(CssPropertyValue::$content_type),
            CssPropertyType::CaretWidth => CssProperty::CaretWidth(CssPropertyValue::$content_type),
            CssPropertyType::CaretAnimationDuration => {
                CssProperty::CaretAnimationDuration(CssPropertyValue::$content_type)
            }
            CssPropertyType::SelectionBackgroundColor => {
                CssProperty::SelectionBackgroundColor(CssPropertyValue::$content_type)
            }
            CssPropertyType::SelectionColor => {
                CssProperty::SelectionColor(CssPropertyValue::$content_type)
            }
            CssPropertyType::SelectionRadius => {
                CssProperty::SelectionRadius(CssPropertyValue::$content_type)
            }

            CssPropertyType::TextColor => CssProperty::TextColor(CssPropertyValue::$content_type),
            CssPropertyType::FontSize => CssProperty::FontSize(CssPropertyValue::$content_type),
            CssPropertyType::FontFamily => CssProperty::FontFamily(CssPropertyValue::$content_type),
            CssPropertyType::TextAlign => CssProperty::TextAlign(CssPropertyValue::$content_type),
            CssPropertyType::VerticalAlign => {
                CssProperty::VerticalAlign(CssPropertyValue::$content_type)
            }
            CssPropertyType::LetterSpacing => {
                CssProperty::LetterSpacing(CssPropertyValue::$content_type)
            }
            CssPropertyType::TextIndent => CssProperty::TextIndent(CssPropertyValue::$content_type),
            CssPropertyType::InitialLetter => {
                CssProperty::InitialLetter(CssPropertyValue::$content_type)
            }
            CssPropertyType::LineClamp => CssProperty::LineClamp(CssPropertyValue::$content_type),
            CssPropertyType::HangingPunctuation => {
                CssProperty::HangingPunctuation(CssPropertyValue::$content_type)
            }
            CssPropertyType::TextCombineUpright => {
                CssProperty::TextCombineUpright(CssPropertyValue::$content_type)
            }
            CssPropertyType::ExclusionMargin => {
                CssProperty::ExclusionMargin(CssPropertyValue::$content_type)
            }
            CssPropertyType::HyphenationLanguage => {
                CssProperty::HyphenationLanguage(CssPropertyValue::$content_type)
            }
            CssPropertyType::LineHeight => CssProperty::LineHeight(CssPropertyValue::$content_type),
            CssPropertyType::WordSpacing => {
                CssProperty::WordSpacing(CssPropertyValue::$content_type)
            }
            CssPropertyType::TabSize => CssProperty::TabSize(CssPropertyValue::$content_type),
            CssPropertyType::Cursor => CssProperty::Cursor(CssPropertyValue::$content_type),
            CssPropertyType::Display => CssProperty::Display(CssPropertyValue::$content_type),
            CssPropertyType::Float => CssProperty::Float(CssPropertyValue::$content_type),
            CssPropertyType::BoxSizing => CssProperty::BoxSizing(CssPropertyValue::$content_type),
            CssPropertyType::Width => CssProperty::Width(CssPropertyValue::$content_type),
            CssPropertyType::Height => CssProperty::Height(CssPropertyValue::$content_type),
            CssPropertyType::MinWidth => CssProperty::MinWidth(CssPropertyValue::$content_type),
            CssPropertyType::MinHeight => CssProperty::MinHeight(CssPropertyValue::$content_type),
            CssPropertyType::MaxWidth => CssProperty::MaxWidth(CssPropertyValue::$content_type),
            CssPropertyType::MaxHeight => CssProperty::MaxHeight(CssPropertyValue::$content_type),
            CssPropertyType::Position => CssProperty::Position(CssPropertyValue::$content_type),
            CssPropertyType::Top => CssProperty::Top(CssPropertyValue::$content_type),
            CssPropertyType::Right => CssProperty::Right(CssPropertyValue::$content_type),
            CssPropertyType::Left => CssProperty::Left(CssPropertyValue::$content_type),
            CssPropertyType::Bottom => CssProperty::Bottom(CssPropertyValue::$content_type),
            CssPropertyType::ZIndex => CssProperty::ZIndex(CssPropertyValue::$content_type),
            CssPropertyType::FlexWrap => CssProperty::FlexWrap(CssPropertyValue::$content_type),
            CssPropertyType::FlexDirection => {
                CssProperty::FlexDirection(CssPropertyValue::$content_type)
            }
            CssPropertyType::FlexGrow => CssProperty::FlexGrow(CssPropertyValue::$content_type),
            CssPropertyType::FlexShrink => CssProperty::FlexShrink(CssPropertyValue::$content_type),
            CssPropertyType::FlexBasis => CssProperty::FlexBasis(CssPropertyValue::$content_type),
            CssPropertyType::JustifyContent => {
                CssProperty::JustifyContent(CssPropertyValue::$content_type)
            }
            CssPropertyType::AlignItems => CssProperty::AlignItems(CssPropertyValue::$content_type),
            CssPropertyType::AlignContent => {
                CssProperty::AlignContent(CssPropertyValue::$content_type)
            }
            CssPropertyType::ColumnGap => CssProperty::ColumnGap(CssPropertyValue::$content_type),
            CssPropertyType::RowGap => CssProperty::RowGap(CssPropertyValue::$content_type),
            CssPropertyType::GridTemplateColumns => {
                CssProperty::GridTemplateColumns(CssPropertyValue::$content_type)
            }
            CssPropertyType::GridTemplateRows => {
                CssProperty::GridTemplateRows(CssPropertyValue::$content_type)
            }
            CssPropertyType::GridAutoColumns => {
                CssProperty::GridAutoColumns(CssPropertyValue::$content_type)
            }
            CssPropertyType::GridAutoFlow => {
                CssProperty::GridAutoFlow(CssPropertyValue::$content_type)
            }
            CssPropertyType::JustifySelf => {
                CssProperty::JustifySelf(CssPropertyValue::$content_type)
            }
            CssPropertyType::JustifyItems => {
                CssProperty::JustifyItems(CssPropertyValue::$content_type)
            }
            CssPropertyType::Gap => CssProperty::Gap(CssPropertyValue::$content_type),
            CssPropertyType::GridGap => CssProperty::GridGap(CssPropertyValue::$content_type),
            CssPropertyType::AlignSelf => CssProperty::AlignSelf(CssPropertyValue::$content_type),
            CssPropertyType::Font => CssProperty::Font(CssPropertyValue::$content_type),
            CssPropertyType::GridAutoRows => {
                CssProperty::GridAutoRows(CssPropertyValue::$content_type)
            }
            CssPropertyType::GridColumn => CssProperty::GridColumn(CssPropertyValue::$content_type),
            CssPropertyType::GridRow => CssProperty::GridRow(CssPropertyValue::$content_type),
            CssPropertyType::GridTemplateAreas => {
                CssProperty::GridTemplateAreas(CssPropertyValue::$content_type)
            }
            CssPropertyType::WritingMode => {
                CssProperty::WritingMode(CssPropertyValue::$content_type)
            }
            CssPropertyType::Clear => CssProperty::Clear(CssPropertyValue::$content_type),
            CssPropertyType::OverflowX => CssProperty::OverflowX(CssPropertyValue::$content_type),
            CssPropertyType::OverflowY => CssProperty::OverflowY(CssPropertyValue::$content_type),
            CssPropertyType::OverflowBlock => CssProperty::OverflowBlock(CssPropertyValue::$content_type),
            CssPropertyType::OverflowInline => CssProperty::OverflowInline(CssPropertyValue::$content_type),
            CssPropertyType::PaddingTop => CssProperty::PaddingTop(CssPropertyValue::$content_type),
            CssPropertyType::PaddingLeft => {
                CssProperty::PaddingLeft(CssPropertyValue::$content_type)
            }
            CssPropertyType::PaddingRight => {
                CssProperty::PaddingRight(CssPropertyValue::$content_type)
            }
            CssPropertyType::PaddingBottom => {
                CssProperty::PaddingBottom(CssPropertyValue::$content_type)
            }
            CssPropertyType::PaddingInlineStart => {
                CssProperty::PaddingInlineStart(CssPropertyValue::$content_type)
            }
            CssPropertyType::PaddingInlineEnd => {
                CssProperty::PaddingInlineEnd(CssPropertyValue::$content_type)
            }
            CssPropertyType::MarginTop => CssProperty::MarginTop(CssPropertyValue::$content_type),
            CssPropertyType::MarginLeft => CssProperty::MarginLeft(CssPropertyValue::$content_type),
            CssPropertyType::MarginRight => {
                CssProperty::MarginRight(CssPropertyValue::$content_type)
            }
            CssPropertyType::MarginBottom => {
                CssProperty::MarginBottom(CssPropertyValue::$content_type)
            }
            CssPropertyType::BackgroundContent => {
                CssProperty::BackgroundContent(CssPropertyValue::$content_type)
            }
            CssPropertyType::BackgroundPosition => {
                CssProperty::BackgroundPosition(CssPropertyValue::$content_type)
            }
            CssPropertyType::BackgroundSize => {
                CssProperty::BackgroundSize(CssPropertyValue::$content_type)
            }
            CssPropertyType::BackgroundRepeat => {
                CssProperty::BackgroundRepeat(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderTopLeftRadius => {
                CssProperty::BorderTopLeftRadius(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderTopRightRadius => {
                CssProperty::BorderTopRightRadius(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderBottomLeftRadius => {
                CssProperty::BorderBottomLeftRadius(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderBottomRightRadius => {
                CssProperty::BorderBottomRightRadius(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderTopColor => {
                CssProperty::BorderTopColor(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderRightColor => {
                CssProperty::BorderRightColor(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderLeftColor => {
                CssProperty::BorderLeftColor(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderBottomColor => {
                CssProperty::BorderBottomColor(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderTopStyle => {
                CssProperty::BorderTopStyle(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderRightStyle => {
                CssProperty::BorderRightStyle(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderLeftStyle => {
                CssProperty::BorderLeftStyle(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderBottomStyle => {
                CssProperty::BorderBottomStyle(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderTopWidth => {
                CssProperty::BorderTopWidth(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderRightWidth => {
                CssProperty::BorderRightWidth(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderLeftWidth => {
                CssProperty::BorderLeftWidth(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderBottomWidth => {
                CssProperty::BorderBottomWidth(CssPropertyValue::$content_type)
            }
            CssPropertyType::BoxShadowLeft => {
                CssProperty::BoxShadowLeft(CssPropertyValue::$content_type)
            }
            CssPropertyType::BoxShadowRight => {
                CssProperty::BoxShadowRight(CssPropertyValue::$content_type)
            }
            CssPropertyType::BoxShadowTop => {
                CssProperty::BoxShadowTop(CssPropertyValue::$content_type)
            }
            CssPropertyType::BoxShadowBottom => {
                CssProperty::BoxShadowBottom(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarTrack => {
                CssProperty::ScrollbarTrack(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarThumb => {
                CssProperty::ScrollbarThumb(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarButton => {
                CssProperty::ScrollbarButton(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarCorner => {
                CssProperty::ScrollbarCorner(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarResizer => {
                CssProperty::ScrollbarResizer(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarWidth => {
                CssProperty::ScrollbarWidth(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarColor => {
                CssProperty::ScrollbarColor(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarVisibility => {
                CssProperty::ScrollbarVisibility(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarFadeDelay => {
                CssProperty::ScrollbarFadeDelay(CssPropertyValue::$content_type)
            }
            CssPropertyType::ScrollbarFadeDuration => {
                CssProperty::ScrollbarFadeDuration(CssPropertyValue::$content_type)
            }
            CssPropertyType::Opacity => CssProperty::Opacity(CssPropertyValue::$content_type),
            CssPropertyType::Visibility => CssProperty::Visibility(CssPropertyValue::$content_type),
            CssPropertyType::Transform => CssProperty::Transform(CssPropertyValue::$content_type),
            CssPropertyType::PerspectiveOrigin => {
                CssProperty::PerspectiveOrigin(CssPropertyValue::$content_type)
            }
            CssPropertyType::TransformOrigin => {
                CssProperty::TransformOrigin(CssPropertyValue::$content_type)
            }
            CssPropertyType::BackfaceVisibility => {
                CssProperty::BackfaceVisibility(CssPropertyValue::$content_type)
            }
            CssPropertyType::MixBlendMode => {
                CssProperty::MixBlendMode(CssPropertyValue::$content_type)
            }
            CssPropertyType::Filter => CssProperty::Filter(CssPropertyValue::$content_type),
            CssPropertyType::BackdropFilter => {
                CssProperty::BackdropFilter(CssPropertyValue::$content_type)
            }
            CssPropertyType::TextShadow => CssProperty::TextShadow(CssPropertyValue::$content_type),
            CssPropertyType::Direction => CssProperty::Direction(CssPropertyValue::$content_type),
            CssPropertyType::Hyphens => CssProperty::Hyphens(CssPropertyValue::$content_type),
            CssPropertyType::WordBreak => CssProperty::WordBreak(CssPropertyValue::$content_type),
            CssPropertyType::OverflowWrap => CssProperty::OverflowWrap(CssPropertyValue::$content_type),
            CssPropertyType::LineBreak => CssProperty::LineBreak(CssPropertyValue::$content_type),
            CssPropertyType::ObjectFit => CssProperty::ObjectFit(CssPropertyValue::$content_type),
            CssPropertyType::ObjectPosition => CssProperty::ObjectPosition(CssPropertyValue::$content_type),
            CssPropertyType::AspectRatio => CssProperty::AspectRatio(CssPropertyValue::$content_type),
            CssPropertyType::TextOrientation => CssProperty::TextOrientation(CssPropertyValue::$content_type),
            CssPropertyType::TextAlignLast => CssProperty::TextAlignLast(CssPropertyValue::$content_type),
            CssPropertyType::WhiteSpace => CssProperty::WhiteSpace(CssPropertyValue::$content_type),
            CssPropertyType::UserSelect => CssProperty::UserSelect(CssPropertyValue::$content_type),
            CssPropertyType::TextDecoration => {
                CssProperty::TextDecoration(CssPropertyValue::$content_type)
            }
            // Fragmentation / Columns / Flow / Shape / Content
            CssPropertyType::TextJustify => {
                CssProperty::TextJustify(CssPropertyValue::$content_type)
            }
            CssPropertyType::BreakBefore => {
                CssProperty::BreakBefore(CssPropertyValue::$content_type)
            }
            CssPropertyType::BreakAfter => CssProperty::BreakAfter(CssPropertyValue::$content_type),
            CssPropertyType::BreakInside => {
                CssProperty::BreakInside(CssPropertyValue::$content_type)
            }
            CssPropertyType::Widows => CssProperty::Widows(CssPropertyValue::$content_type),
            CssPropertyType::Orphans => CssProperty::Orphans(CssPropertyValue::$content_type),
            CssPropertyType::BoxDecorationBreak => {
                CssProperty::BoxDecorationBreak(CssPropertyValue::$content_type)
            }
            CssPropertyType::ColumnCount => {
                CssProperty::ColumnCount(CssPropertyValue::$content_type)
            }
            CssPropertyType::ColumnWidth => {
                CssProperty::ColumnWidth(CssPropertyValue::$content_type)
            }
            CssPropertyType::ColumnSpan => CssProperty::ColumnSpan(CssPropertyValue::$content_type),
            CssPropertyType::ColumnFill => CssProperty::ColumnFill(CssPropertyValue::$content_type),
            CssPropertyType::ColumnRuleWidth => {
                CssProperty::ColumnRuleWidth(CssPropertyValue::$content_type)
            }
            CssPropertyType::ColumnRuleStyle => {
                CssProperty::ColumnRuleStyle(CssPropertyValue::$content_type)
            }
            CssPropertyType::ColumnRuleColor => {
                CssProperty::ColumnRuleColor(CssPropertyValue::$content_type)
            }
            CssPropertyType::FlowInto => CssProperty::FlowInto(CssPropertyValue::$content_type),
            CssPropertyType::FlowFrom => CssProperty::FlowFrom(CssPropertyValue::$content_type),
            CssPropertyType::ShapeOutside => {
                CssProperty::ShapeOutside(CssPropertyValue::$content_type)
            }
            CssPropertyType::ShapeInside => {
                CssProperty::ShapeInside(CssPropertyValue::$content_type)
            }
            CssPropertyType::ClipPath => CssProperty::ClipPath(CssPropertyValue::$content_type),
            CssPropertyType::ShapeMargin => {
                CssProperty::ShapeMargin(CssPropertyValue::$content_type)
            }
            CssPropertyType::ShapeImageThreshold => {
                CssProperty::ShapeImageThreshold(CssPropertyValue::$content_type)
            }
            CssPropertyType::Content => CssProperty::Content(CssPropertyValue::$content_type),
            CssPropertyType::CounterReset => {
                CssProperty::CounterReset(CssPropertyValue::$content_type)
            }
            CssPropertyType::CounterIncrement => {
                CssProperty::CounterIncrement(CssPropertyValue::$content_type)
            }
            CssPropertyType::ListStyleType => {
                CssProperty::ListStyleType(CssPropertyValue::$content_type)
            }
            CssPropertyType::ListStylePosition => {
                CssProperty::ListStylePosition(CssPropertyValue::$content_type)
            }
            CssPropertyType::StringSet => CssProperty::StringSet(CssPropertyValue::$content_type),
            CssPropertyType::TableLayout => {
                CssProperty::TableLayout(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderCollapse => {
                CssProperty::BorderCollapse(CssPropertyValue::$content_type)
            }
            CssPropertyType::BorderSpacing => {
                CssProperty::BorderSpacing(CssPropertyValue::$content_type)
            }
            CssPropertyType::CaptionSide => {
                CssProperty::CaptionSide(CssPropertyValue::$content_type)
            }
            CssPropertyType::EmptyCells => CssProperty::EmptyCells(CssPropertyValue::$content_type),
            CssPropertyType::FontWeight => CssProperty::FontWeight(CssPropertyValue::$content_type),
            CssPropertyType::FontStyle => CssProperty::FontStyle(CssPropertyValue::$content_type),
            CssPropertyType::UnicodeBidi => CssProperty::UnicodeBidi(CssPropertyValue::$content_type),
            CssPropertyType::TextBoxTrim => CssProperty::TextBoxTrim(CssPropertyValue::$content_type),
            CssPropertyType::TextBoxEdge => CssProperty::TextBoxEdge(CssPropertyValue::$content_type),
            CssPropertyType::DominantBaseline => CssProperty::DominantBaseline(CssPropertyValue::$content_type),
            CssPropertyType::AlignmentBaseline => CssProperty::AlignmentBaseline(CssPropertyValue::$content_type),
            CssPropertyType::InitialLetterAlign => CssProperty::InitialLetterAlign(CssPropertyValue::$content_type),
            CssPropertyType::InitialLetterWrap => CssProperty::InitialLetterWrap(CssPropertyValue::$content_type),
            CssPropertyType::ScrollbarGutter => CssProperty::ScrollbarGutter(CssPropertyValue::$content_type),
            CssPropertyType::OverflowClipMargin => CssProperty::OverflowClipMargin(CssPropertyValue::$content_type),
            CssPropertyType::Clip => CssProperty::Clip(CssPropertyValue::$content_type),
        }
    }};
}