diff --git a/crates/hdx_ast/src/css/rules/page.rs b/crates/hdx_ast/src/css/rules/page.rs index 88781b13..6f2e3d32 100644 --- a/crates/hdx_ast/src/css/rules/page.rs +++ b/crates/hdx_ast/src/css/rules/page.rs @@ -49,7 +49,7 @@ impl<'a> PageSelector<'a> { } #[derive(Atomizable, Debug, Clone, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "lowercase"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "kebab-case"))] pub enum PagePseudoClass { Left, Right, diff --git a/crates/hdx_ast/src/css/selector/mod.rs b/crates/hdx_ast/src/css/selector/mod.rs index 48e72bd6..9057d3a9 100644 --- a/crates/hdx_ast/src/css/selector/mod.rs +++ b/crates/hdx_ast/src/css/selector/mod.rs @@ -104,7 +104,7 @@ pub enum AttributeModifier { } #[derive(Atomizable, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "kebab-case"))] pub enum PseudoClass { Active, // atom!("active") AnyLink, // atom!("any-link") @@ -178,7 +178,7 @@ pub enum PseudoFunction<'a> { } #[derive(Atomizable, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum DirValue { Rtl, // atom!("rtl") Ltr, // atom!("ltr") diff --git a/crates/hdx_ast/src/css/stylesheet.rs b/crates/hdx_ast/src/css/stylesheet.rs index b12377e3..356260e1 100644 --- a/crates/hdx_ast/src/css/stylesheet.rs +++ b/crates/hdx_ast/src/css/stylesheet.rs @@ -14,7 +14,7 @@ use crate::{ // https://drafts.csswg.org/cssom-1/#the-cssstylesheet-interface #[derive(Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))] pub struct CSSStyleSheet<'a> { pub rules: Vec<'a, CSSRule<'a>>, } diff --git a/crates/hdx_ast/src/css/values/backgrounds.rs b/crates/hdx_ast/src/css/values/backgrounds.rs index ab5635c8..bd20893d 100644 --- a/crates/hdx_ast/src/css/values/backgrounds.rs +++ b/crates/hdx_ast/src/css/values/backgrounds.rs @@ -26,7 +26,7 @@ pub enum LineWidth { // https://drafts.csswg.org/css-backgrounds-3/#typedef-line-style #[derive(Atomizable, Debug, Default, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum LineStyle { #[default] None, // atom!("none") diff --git a/crates/hdx_ast/src/css/values/break.rs b/crates/hdx_ast/src/css/values/break.rs index b8fda8a6..e63c7167 100644 --- a/crates/hdx_ast/src/css/values/break.rs +++ b/crates/hdx_ast/src/css/values/break.rs @@ -5,7 +5,7 @@ use crate::{atom, Atom, Atomizable}; // https://drafts.csswg.org/css-break-4/#propdef-box-decoration-break #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum BoxDecorationBreakValue { #[default] Slice, // atom!("slice") @@ -14,7 +14,7 @@ pub enum BoxDecorationBreakValue { // https://drafts.csswg.org/css-break-4/#propdef-break-after #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum BreakValue { #[default] Auto, // atom!("auto") @@ -35,7 +35,7 @@ pub enum BreakValue { // https://drafts.csswg.org/css-break-4/#propdef-break-inside #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum BreakInsideValue { #[default] Auto, // atom!("auto") @@ -47,7 +47,7 @@ pub enum BreakInsideValue { // https://drafts.csswg.org/css-break-4/#propdef-margin-break #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum MarginBreakValue { #[default] Auto, // atom!("auto") diff --git a/crates/hdx_ast/src/css/values/color.rs b/crates/hdx_ast/src/css/values/color.rs index 02bb4805..dec3849e 100644 --- a/crates/hdx_ast/src/css/values/color.rs +++ b/crates/hdx_ast/src/css/values/color.rs @@ -241,7 +241,7 @@ impl<'a> ColorValue<'a> { } #[derive(Atomizable, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "name", rename_all = "lowercase"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum NamedColor { Aliceblue, // atom!("aliceblue") Antiquewhite, // atom!("antiquewhite") diff --git a/crates/hdx_ast/src/css/values/content.rs b/crates/hdx_ast/src/css/values/content.rs index d477c85f..eef349fc 100644 --- a/crates/hdx_ast/src/css/values/content.rs +++ b/crates/hdx_ast/src/css/values/content.rs @@ -53,7 +53,7 @@ pub enum ContentElement<'a> { // https://drafts.csswg.org/css-content-3/#typedef-quote #[derive(Atomizable, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum Quote { OpenQuote, // atom!("open-quote") CloseQuote, // atom!("close-quote") diff --git a/crates/hdx_ast/src/css/values/counter_styles.rs b/crates/hdx_ast/src/css/values/counter_styles.rs index aaa51160..349d3494 100644 --- a/crates/hdx_ast/src/css/values/counter_styles.rs +++ b/crates/hdx_ast/src/css/values/counter_styles.rs @@ -14,7 +14,7 @@ pub enum CounterStyle<'a> { // https://drafts.csswg.org/css-counter-styles-3/#predefined-counters #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum PredefinedCounterStyle { Decimal, // atom!("decimal"), DecimalLeadingZero, // atom!("decimal-leading-zero"), @@ -79,7 +79,7 @@ pub enum Symbol<'a> { // https://drafts.csswg.org/css-counter-styles-3/#typedef-symbols-type #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum SymbolsType { Cyclic, // atom!("cyclic") Numeric, // atom!("numeric") diff --git a/crates/hdx_ast/src/css/values/display.rs b/crates/hdx_ast/src/css/values/display.rs index fb3514d8..50611400 100644 --- a/crates/hdx_ast/src/css/values/display.rs +++ b/crates/hdx_ast/src/css/values/display.rs @@ -218,7 +218,7 @@ impl DisplayMarker { // https://drafts.csswg.org/css-display-4/#propdef-visibility #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum VisibilityValue { #[default] Visible, // atom!("visible") diff --git a/crates/hdx_ast/src/css/values/fonts.rs b/crates/hdx_ast/src/css/values/fonts.rs index d09c50f0..202f010d 100644 --- a/crates/hdx_ast/src/css/values/fonts.rs +++ b/crates/hdx_ast/src/css/values/fonts.rs @@ -6,7 +6,7 @@ use crate::{atom, Atom, Atomizable, Spanned}; // https://drafts.csswg.org/css2/#value-def-absolute-size #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum AbsoluteSize { XxSmall, // atom!("xx-small") XSmall, // atom!("x-small") @@ -20,7 +20,7 @@ pub enum AbsoluteSize { // https://drafts.csswg.org/css2/#value-def-relative-size #[derive(Atomizable, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum RelativeSize { Larger, // atom!("larger") Smaller, // atom!("smaller") diff --git a/crates/hdx_ast/src/css/values/images.rs b/crates/hdx_ast/src/css/values/images.rs index 87be4576..15990f20 100644 --- a/crates/hdx_ast/src/css/values/images.rs +++ b/crates/hdx_ast/src/css/values/images.rs @@ -43,7 +43,7 @@ pub enum RadialGradientSize { // https://drafts.csswg.org/css-images-3/#typedef-rg-ending-shape #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum RadialGradientEndingShape { #[default] Circle, // atom!("circle") diff --git a/crates/hdx_ast/src/css/values/inline.rs b/crates/hdx_ast/src/css/values/inline.rs index 1d6a9a54..b4c00f16 100644 --- a/crates/hdx_ast/src/css/values/inline.rs +++ b/crates/hdx_ast/src/css/values/inline.rs @@ -8,7 +8,7 @@ use crate::{atom, Atom, Atomizable, Spanned}; // https://drafts.csswg.org/css-inline/#propdef-alignment-baseline #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum AlignmentBaselineValue { #[default] Baseline, // atom!("baseline") @@ -23,7 +23,7 @@ pub enum AlignmentBaselineValue { // https://drafts.csswg.org/css-inline/#propdef-baseline-source #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum BaselineSourceValue { #[default] Auto, // atom!("auto") @@ -51,7 +51,7 @@ impl Default for BaselineShiftValue { // https://drafts.csswg.org/css-inline/#propdef-dominant-baseline #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum DominantBaselineValue { #[default] Auto, // atom!("auto") @@ -67,7 +67,7 @@ pub enum DominantBaselineValue { // https://drafts.csswg.org/css-inline/#propdef-inline-sizing #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum InlineSizingValue { #[default] Normal, // atom!("normal") diff --git a/crates/hdx_ast/src/css/values/lists.rs b/crates/hdx_ast/src/css/values/lists.rs index fcbd947f..cffd68a0 100644 --- a/crates/hdx_ast/src/css/values/lists.rs +++ b/crates/hdx_ast/src/css/values/lists.rs @@ -31,7 +31,7 @@ pub struct Counters<'a> { // https://drafts.csswg.org/css-lists-3/#funcdef-counters #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum ListStylePositionValue { #[default] Outside, // atom!("outside") diff --git a/crates/hdx_ast/src/css/values/overflow.rs b/crates/hdx_ast/src/css/values/overflow.rs index a2de12ef..e983566d 100644 --- a/crates/hdx_ast/src/css/values/overflow.rs +++ b/crates/hdx_ast/src/css/values/overflow.rs @@ -5,7 +5,7 @@ use crate::{atom, Atom, Atomizable}; // https://drafts.csswg.org/css-overflow-3/#propdef-overflow-block #[derive(Atomizable, Copy, Clone, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum OverflowKeyword { #[default] Visible, // atom!("visible") diff --git a/crates/hdx_ast/src/css/values/page_floats.rs b/crates/hdx_ast/src/css/values/page_floats.rs index 836803be..75dca0c8 100644 --- a/crates/hdx_ast/src/css/values/page_floats.rs +++ b/crates/hdx_ast/src/css/values/page_floats.rs @@ -62,7 +62,7 @@ impl FloatValue { } #[derive(Atomizable, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum SnapBlockFloat { Start, // atom!("start") End, // atom!("end") @@ -70,7 +70,7 @@ pub enum SnapBlockFloat { } #[derive(Atomizable, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum SnapInlineFloat { Right, // atom!("right") Left, // atom!("left") @@ -79,7 +79,7 @@ pub enum SnapInlineFloat { // https://drafts.csswg.org/css-page-floats-3/#propdef-clear #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum ClearValue { InlineStart, // atom!("inline-start") InlineEnd, // atom!("inline-end") @@ -138,7 +138,7 @@ impl From for FloatDeferValue { // https://drafts.csswg.org/css-page-floats-3/#propdef-float-reference #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum FloatReferenceValue { #[default] Inline, // atom!("inline") diff --git a/crates/hdx_ast/src/css/values/position.rs b/crates/hdx_ast/src/css/values/position.rs index ab1e59b4..100064f0 100644 --- a/crates/hdx_ast/src/css/values/position.rs +++ b/crates/hdx_ast/src/css/values/position.rs @@ -6,7 +6,7 @@ use crate::{atom, Atom, Atomizable}; // https://drafts.csswg.org/css-position-3/#propdef-position #[derive(Atomizable, Debug, Default, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum PositionValue { #[default] Static, // atom!("static") @@ -18,7 +18,7 @@ pub enum PositionValue { // https://drafts.csswg.org/css-position-3/#inset-shorthands #[derive(Debug, Default, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub struct InsetShorthand<'a> { pub top: Shorthand<'a, MathExpr<'a, LengthPercentageOrAuto>>, pub right: Shorthand<'a, MathExpr<'a, LengthPercentageOrAuto>>, diff --git a/crates/hdx_ast/src/css/values/sizing.rs b/crates/hdx_ast/src/css/values/sizing.rs index 21b275dd..8cd3f8d3 100644 --- a/crates/hdx_ast/src/css/values/sizing.rs +++ b/crates/hdx_ast/src/css/values/sizing.rs @@ -6,7 +6,7 @@ use crate::{atom, Atom, Atomizable, Spanned}; // https://www.w3.org/TR/css-sizing-3/#propdef-box-sizing #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum BoxSizingValue { #[default] ContentBox, // atom!("content-box") @@ -15,7 +15,7 @@ pub enum BoxSizingValue { // https://drafts.csswg.org/css-sizing-4/#sizing-values #[derive(Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum Sizing { #[default] Auto, @@ -30,7 +30,7 @@ pub enum Sizing { } #[derive(Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum MaxSizing { #[default] None, @@ -45,7 +45,7 @@ pub enum MaxSizing { } #[derive(Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum RatioOrAuto { #[default] Auto, @@ -54,7 +54,7 @@ pub enum RatioOrAuto { // https://drafts.csswg.org/css-sizing-4/#intrinsic-contribution-override #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum MinIntrinsicSizingValue { #[default] Legacy, // atom!("legacy") diff --git a/crates/hdx_ast/src/css/values/tables.rs b/crates/hdx_ast/src/css/values/tables.rs index 9a8d7b30..7a4a5ec6 100644 --- a/crates/hdx_ast/src/css/values/tables.rs +++ b/crates/hdx_ast/src/css/values/tables.rs @@ -6,7 +6,7 @@ use crate::{atom, Atom, Atomizable, Span}; // https://drafts.csswg.org/css-tables-3/#propdef-border-collapse #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum BorderCollapseValue { #[default] Separate, // atom!("separate") @@ -15,7 +15,7 @@ pub enum BorderCollapseValue { // https://drafts.csswg.org/css-tables-3/#propdef-caption-side #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum CaptionSideValue { #[default] Top, // atom!("top") @@ -24,7 +24,7 @@ pub enum CaptionSideValue { // https://drafts.csswg.org/css-tables-3/#propdef-caption-side #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum EmptyCellsValue { #[default] Show, // atom!("show") @@ -33,7 +33,7 @@ pub enum EmptyCellsValue { // https://drafts.csswg.org/css-tables-3/#propdef-caption-side #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum TableLayoutValue { #[default] Auto, // atom!("auto") diff --git a/crates/hdx_ast/src/css/values/text.rs b/crates/hdx_ast/src/css/values/text.rs index 8501ba69..38df4f8e 100644 --- a/crates/hdx_ast/src/css/values/text.rs +++ b/crates/hdx_ast/src/css/values/text.rs @@ -6,7 +6,7 @@ use crate::{atom, Atom, Atomizable}; // https://drafts.csswg.org/css-text-4/#propdef-text-align #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum TextAlignValue { #[default] Start, // atom!("start") @@ -22,7 +22,7 @@ pub enum TextAlignValue { // https://drafts.csswg.org/css-text-4/#propdef-text-align-all #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum TextAlignAllValue { #[default] Start, // atom!("start") @@ -36,7 +36,7 @@ pub enum TextAlignAllValue { // https://drafts.csswg.org/css-text-4/#propdef-text-align-last #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum TextAlignLastValue { #[default] Auto, // atom!("auto") @@ -51,7 +51,7 @@ pub enum TextAlignLastValue { // https://drafts.csswg.org/css-text-4/#propdef-text-wrap #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum TextWrapValue { #[default] Wrap, // atom!("wrap") @@ -63,7 +63,7 @@ pub enum TextWrapValue { // https://drafts.csswg.org/css-text-4/#propdef-white-space-collapse #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum WhiteSpaceCollapseValue { #[default] Collapse, // atom!("collapse") @@ -76,7 +76,7 @@ pub enum WhiteSpaceCollapseValue { // https://drafts.csswg.org/css-text-4/#propdef-white-space-trim #[derive(Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum WhiteSpaceTrimValue { #[default] None, @@ -89,7 +89,7 @@ pub enum WhiteSpaceTrimValue { // https://drafts.csswg.org/css-text-4/#propdef-white-space #[derive(Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum WhiteSpaceShorthand<'a> { #[default] Normal, diff --git a/crates/hdx_ast/src/css/values/text_decor.rs b/crates/hdx_ast/src/css/values/text_decor.rs index b6b7167f..7b57d91a 100644 --- a/crates/hdx_ast/src/css/values/text_decor.rs +++ b/crates/hdx_ast/src/css/values/text_decor.rs @@ -29,7 +29,7 @@ pub enum TextDecorationLineValue { // https://drafts.csswg.org/css-text/#text-align-property #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum TextDecorationSkipInkValue { #[default] Auto, // atom!("auto") @@ -39,7 +39,7 @@ pub enum TextDecorationSkipInkValue { // https://drafts.csswg.org/css-text/#text-align-property #[derive(Atomizable, Default, Debug, PartialEq, Hash)] -#[cfg_attr(feature = "serde", derive(Serialize), serde())] +#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "kebab-case"))] pub enum TextDecorationStyleValue { #[default] Solid, // atom!("solid"),