mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
Fix generated palette code
- Only include my scales for custom palettes - Do not include bogus role declarations
This commit is contained in:
@@ -51,6 +51,11 @@ export function getPaletteCode({ base, slug = base, colors, tweaked, roles, ...o
|
||||
if (roles) {
|
||||
for (let role in roles) {
|
||||
let hue = roles[role];
|
||||
|
||||
if (!hue) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (let suffix of [...tints.map(t => '-' + t), '', '-key']) {
|
||||
declarations.push(`--${prefix}-${role}${suffix}: var(--${prefix}-${hue}${suffix});`);
|
||||
}
|
||||
|
||||
@@ -409,7 +409,7 @@ let paletteAppSpec = {
|
||||
let code = getPaletteCode({
|
||||
base: this.paletteId,
|
||||
slug: this.isCustom ? this.slug : undefined,
|
||||
colors: this.colors,
|
||||
colors: this.paletteScales,
|
||||
tweaked: this.tweaked,
|
||||
roles: this.isCustom ? this.computedRoles : this.roles,
|
||||
language,
|
||||
|
||||
Reference in New Issue
Block a user