From f6ff4b10e6fa8872a16d5f9583eb9eee3a51d8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 28 Jul 2025 06:08:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(color-module):=20=E4=BF=AE=E6=AD=A3surface?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E7=9A=84=E5=91=BD=E5=90=8D=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一surface变量的命名格式,在CSS、SCSS和JavaScript中使用一致的命名规则 --- color-module/src/schemes/q_style_2/baseline.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/color-module/src/schemes/q_style_2/baseline.rs b/color-module/src/schemes/q_style_2/baseline.rs index b4c9d74..ab76a85 100644 --- a/color-module/src/schemes/q_style_2/baseline.rs +++ b/color-module/src/schemes/q_style_2/baseline.rs @@ -49,7 +49,10 @@ impl ColorUnit { let mut css_variables = Vec::new(); css_variables.extend(self.root.to_css_variables(prefix, name)); - css_variables.extend(self.surface.to_css_variables(prefix, name)); + css_variables.extend( + self.surface + .to_css_variables(prefix, &format!("{name}-surface")), + ); css_variables.extend(self.swatch.to_css_variables(prefix, name)); css_variables @@ -59,7 +62,10 @@ impl ColorUnit { let mut css_auto_scheme_collection = LinkedHashMap::new(); css_auto_scheme_collection.extend(self.root.to_css_auto_scheme_collection(name)); - css_auto_scheme_collection.extend(self.surface.to_css_auto_scheme_collection(name)); + css_auto_scheme_collection.extend( + self.surface + .to_css_auto_scheme_collection(&format!("{name}-surface")), + ); css_auto_scheme_collection.extend(self.swatch.to_css_auto_scheme_collection(name)); css_auto_scheme_collection @@ -69,7 +75,10 @@ impl ColorUnit { let mut scss_variables = Vec::new(); scss_variables.extend(self.root.to_scss_variables(prefix, name)); - scss_variables.extend(self.surface.to_scss_variables(prefix, name)); + scss_variables.extend( + self.surface + .to_scss_variables(prefix, &format!("{name}-surface")), + ); scss_variables.extend(self.swatch.to_scss_variables(prefix, name)); scss_variables @@ -79,7 +88,7 @@ impl ColorUnit { let mut js_object_fields = Vec::new(); js_object_fields.extend(self.root.to_javascript_fields(name)); - js_object_fields.extend(self.surface.to_javascript_fields(name)); + js_object_fields.extend(self.surface.to_javascript_fields(&format!("{name}Surface"))); js_object_fields.extend(self.swatch.to_javascript_fields(name)); js_object_fields