fix(color-module): 修正surface变量的命名格式
统一surface变量的命名格式,在CSS、SCSS和JavaScript中使用一致的命名规则
This commit is contained in:
parent
1e4a9fd858
commit
f6ff4b10e6
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user