调整输出自定义颜色变量名称的大小写。
This commit is contained in:
parent
639b6b223e
commit
1a136670ff
|
@ -75,7 +75,7 @@ impl M2BaselineColors {
|
|||
variable_lines.push(format!("--color-{}-shadow: #{};", prefix, self.shadow));
|
||||
|
||||
for (name, color_set) in &self.custom_colors {
|
||||
variable_lines.extend(color_set.to_css_variable(&prefix, name));
|
||||
variable_lines.extend(color_set.to_css_variable(&prefix, &name.to_lowercase()));
|
||||
}
|
||||
|
||||
variable_lines
|
||||
|
@ -93,7 +93,7 @@ impl M2BaselineColors {
|
|||
variable_lines.push(format!("$color-{}-shadow: #{};", prefix, self.shadow));
|
||||
|
||||
for (name, color_set) in &self.custom_colors {
|
||||
variable_lines.extend(color_set.to_scss_variable(&prefix, name));
|
||||
variable_lines.extend(color_set.to_scss_variable(&prefix, &name.to_lowercase()));
|
||||
}
|
||||
|
||||
variable_lines
|
||||
|
@ -111,7 +111,7 @@ impl M2BaselineColors {
|
|||
variable_lines.push(format!("{}Shadow: '#{}',", prefix, self.shadow));
|
||||
|
||||
for (name, color_set) in &self.custom_colors {
|
||||
variable_lines.extend(color_set.to_javascript_object(&prefix, name));
|
||||
variable_lines.extend(color_set.to_javascript_object(&prefix, &name.to_lowercase()));
|
||||
}
|
||||
|
||||
variable_lines
|
||||
|
|
|
@ -125,7 +125,7 @@ impl M3BaselineColors {
|
|||
css_variables.push(format!("--color-{}-scrim: #{};", prefix, self.scrim));
|
||||
css_variables.push(format!("--color-{}-shadow: #{};", prefix, self.shadow));
|
||||
for (name, color_set) in &self.customs {
|
||||
css_variables.extend(color_set.to_css_variables(prefix, name));
|
||||
css_variables.extend(color_set.to_css_variables(prefix, &name.to_lowercase()));
|
||||
}
|
||||
|
||||
css_variables
|
||||
|
@ -148,7 +148,7 @@ impl M3BaselineColors {
|
|||
scss_variables.push(format!("$color-{}-scrim: #{};", prefix, self.scrim));
|
||||
scss_variables.push(format!("$color-{}-shadow: #{};", prefix, self.shadow));
|
||||
for (name, color_set) in &self.customs {
|
||||
scss_variables.extend(color_set.to_scss_variables(prefix, name));
|
||||
scss_variables.extend(color_set.to_scss_variables(prefix, &name.to_lowercase()));
|
||||
}
|
||||
|
||||
scss_variables
|
||||
|
@ -177,7 +177,8 @@ impl M3BaselineColors {
|
|||
js_object_fields.push(format!("{}Scrim: '#{}',", prefix, self.scrim));
|
||||
js_object_fields.push(format!("{}Shadow: '#{}',", prefix, self.shadow));
|
||||
for (name, color_set) in &self.customs {
|
||||
js_object_fields.extend(color_set.to_javascript_object_fields(prefix, name));
|
||||
js_object_fields
|
||||
.extend(color_set.to_javascript_object_fields(prefix, &name.to_lowercase()));
|
||||
}
|
||||
|
||||
js_object_fields
|
||||
|
|
|
@ -84,10 +84,10 @@ impl SchemeExport for SwatchScheme {
|
|||
let mut variables = Vec::new();
|
||||
|
||||
for (name, swatch) in &self.light {
|
||||
variables.extend(swatch.to_css_variables("light", name));
|
||||
variables.extend(swatch.to_css_variables("light", &name.to_lowercase()));
|
||||
}
|
||||
for (name, swatch) in &self.dark {
|
||||
variables.extend(swatch.to_css_variables("dark", name));
|
||||
variables.extend(swatch.to_css_variables("dark", &name.to_lowercase()));
|
||||
}
|
||||
|
||||
variables.join("\n")
|
||||
|
@ -97,10 +97,10 @@ impl SchemeExport for SwatchScheme {
|
|||
let mut variables = Vec::new();
|
||||
|
||||
for (name, swatch) in &self.light {
|
||||
variables.extend(swatch.to_scss_variables("light", name));
|
||||
variables.extend(swatch.to_scss_variables("light", &name.to_lowercase()));
|
||||
}
|
||||
for (name, swatch) in &self.dark {
|
||||
variables.extend(swatch.to_scss_variables("dark", name));
|
||||
variables.extend(swatch.to_scss_variables("dark", &name.to_lowercase()));
|
||||
}
|
||||
|
||||
variables.join("\n")
|
||||
|
@ -114,7 +114,7 @@ impl SchemeExport for SwatchScheme {
|
|||
for (name, swatch) in &self.light {
|
||||
object.extend(
|
||||
swatch
|
||||
.to_javascript_fields("light", name)
|
||||
.to_javascript_fields("light", &name.to_lowercase())
|
||||
.iter()
|
||||
.map(|s| format!(" {}", s)),
|
||||
);
|
||||
|
@ -125,7 +125,7 @@ impl SchemeExport for SwatchScheme {
|
|||
for (name, swatch) in &self.dark {
|
||||
object.extend(
|
||||
swatch
|
||||
.to_javascript_fields("dark", name)
|
||||
.to_javascript_fields("dark", &name.to_lowercase())
|
||||
.iter()
|
||||
.map(|s| format!(" {}", s)),
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user