调整M3的导出格式。

This commit is contained in:
徐涛 2025-03-07 10:41:44 +08:00
parent f3f259fd1c
commit 7fba372d08
2 changed files with 3 additions and 1 deletions

View File

@ -153,7 +153,7 @@ impl SchemeExport for MaterialDesign3Scheme {
swatch
.to_javascript_object_fields(name)
.into_iter()
.map(|s| format!(" {}", s)),
.map(|s| format!(" {}", s)),
);
}
js_object.push(" }".to_string());

View File

@ -25,6 +25,7 @@ impl M3PaletteSwatch {
pub fn to_css_variables(&self, name: &str) -> Vec<String> {
let mut variable_lines = Vec::new();
let name = name.replace('_', "-").to_lowercase();
for &tone in SWATCH_TONES.iter() {
let color = self.0.get(&tone).unwrap();
@ -36,6 +37,7 @@ impl M3PaletteSwatch {
pub fn to_scss_variables(&self, name: &str) -> Vec<String> {
let mut variable_lines = Vec::new();
let name = name.replace('_', "-").to_lowercase();
for &tone in SWATCH_TONES.iter() {
let color = self.0.get(&tone).unwrap();