From 155fbf8804a675d5d851d194cc5de0e217d9ebd5 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Fri, 9 Jun 2023 10:20:04 +0200 Subject: [PATCH] style: Make #[css(represents_keyword)] convert underscore in the field name to dash Differential Revision: https://phabricator.services.mozilla.com/D128668 --- components/style_derive/to_css.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style_derive/to_css.rs b/components/style_derive/to_css.rs index 1f94751f889..19c7c1ac2bc 100644 --- a/components/style_derive/to_css.rs +++ b/components/style_derive/to_css.rs @@ -208,7 +208,7 @@ fn derive_single_field_expr( .ident .as_ref() .expect("Unnamed field with represents_keyword?"); - let ident = cg::to_css_identifier(&ident.to_string()); + let ident = cg::to_css_identifier(&ident.to_string()).replace("_", "-"); quote! { if *#field { writer.raw_item(#ident)?;