Fixed casing
parent
2ebda30c10
commit
aec97b279e
|
@ -120,7 +120,8 @@ export default {
|
||||||
},
|
},
|
||||||
generateACTokens(parentPath, obj) {
|
generateACTokens(parentPath, obj) {
|
||||||
for (let key in obj) {
|
for (let key in obj) {
|
||||||
if (key === 'dark' || key === 'components') {
|
|
||||||
|
if (key === 'dark' || key === 'components' || key === 'directives') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +132,7 @@ export default {
|
||||||
this.generateACTokens(parentPath ? parentPath + '.' + key : key, obj[key]);
|
this.generateACTokens(parentPath ? parentPath + '.' + key : key, obj[key]);
|
||||||
} else {
|
} else {
|
||||||
const regex = /\.\d+$/;
|
const regex = /\.\d+$/;
|
||||||
|
|
||||||
const tokenName = this.camelCaseToDotCase(parentPath ? parentPath + '.' + key : key);
|
const tokenName = this.camelCaseToDotCase(parentPath ? parentPath + '.' + key : key);
|
||||||
const tokenValue = $dt(tokenName).value;
|
const tokenValue = $dt(tokenName).value;
|
||||||
const isColor = tokenName.includes('color') || tokenName.includes('background') || regex.test(tokenName);
|
const isColor = tokenName.includes('color') || tokenName.includes('background') || regex.test(tokenName);
|
||||||
|
|
|
@ -173,8 +173,8 @@ export default {
|
||||||
key: t_key,
|
key: t_key,
|
||||||
preset: preset,
|
preset: preset,
|
||||||
config: {
|
config: {
|
||||||
baseFontSize: '14px',
|
font_size: '14px',
|
||||||
fontFamily: 'Inter var'
|
font_family: 'Inter var'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.design;
|
this.design;
|
||||||
|
|
|
@ -175,8 +175,8 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
usePreset(this.$appState.designer.theme.preset);
|
usePreset(this.$appState.designer.theme.preset);
|
||||||
this.designerService.applyFont(this.$appState.designer.theme.config.fontFamily);
|
this.designerService.applyFont(this.$appState.designer.theme.config.font_family);
|
||||||
document.documentElement.style.fontSize = this.$appState.designer.theme.config.baseFontSize;
|
document.documentElement.style.fontSize = this.$appState.designer.theme.config.font_size;
|
||||||
this.designerService.refreshACTokens();
|
this.designerService.refreshACTokens();
|
||||||
this.$appState.designer.activeView = 'editor';
|
this.$appState.designer.activeView = 'editor';
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<div class="text-sm mb-1 font-semibold text-surface-950 dark:text-surface-0">Base</div>
|
<div class="text-sm mb-1 font-semibold text-surface-950 dark:text-surface-0">Base</div>
|
||||||
<select v-model="$appState.designer.theme.config.baseFontSize" @change="changeBaseFontSize" class="appearance-none px-3 py-2 rounded-md border border-surface-300 dark:border-surface-700 w-20">
|
<select v-model="$appState.designer.theme.config.font_size" @change="changeBaseFontSize" class="appearance-none px-3 py-2 rounded-md border border-surface-300 dark:border-surface-700 w-20">
|
||||||
<option v-for="fontSize of fontSizes" :key="fontSize" :value="fontSize">{{ fontSize }}</option>
|
<option v-for="fontSize of fontSizes" :key="fontSize" :value="fontSize">{{ fontSize }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="text-sm mb-1 font-semibold text-surface-950 dark:text-surface-0">Family</div>
|
<div class="text-sm mb-1 font-semibold text-surface-950 dark:text-surface-0">Family</div>
|
||||||
<select v-model="$appState.designer.theme.config.fontFamily" @change="changeFont" class="appearance-none px-3 py-2 rounded-md border border-surface-300 dark:border-surface-700 w-48">
|
<select v-model="$appState.designer.theme.config.font_family" @change="changeFont" class="appearance-none px-3 py-2 rounded-md border border-surface-300 dark:border-surface-700 w-48">
|
||||||
<option v-for="font of fonts" :key="font" :value="font">{{ font }}</option>
|
<option v-for="font of fonts" :key="font" :value="font">{{ font }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,11 +44,11 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeFont() {
|
changeFont() {
|
||||||
this.designerService.applyFont(this.$appState.designer.theme.config.fontFamily);
|
this.designerService.applyFont(this.$appState.designer.theme.config.font_size);
|
||||||
this.designerService.saveTheme(this.$appState.designer.theme);
|
this.designerService.saveTheme(this.$appState.designer.theme);
|
||||||
},
|
},
|
||||||
changeBaseFontSize() {
|
changeBaseFontSize() {
|
||||||
document.documentElement.style.fontSize = this.$appState.designer.theme.config.baseFontSize;
|
document.documentElement.style.fontSize = this.$appState.designer.theme.config.font_family;
|
||||||
this.designerService.saveTheme(this.$appState.designer.theme);
|
this.designerService.saveTheme(this.$appState.designer.theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue