make dynamic directives have a type

This commit is contained in:
Henry Jameson 2024-02-19 00:25:28 +02:00
parent 3b520a98ad
commit ab63ec1471
2 changed files with 8 additions and 2 deletions

View File

@ -24,7 +24,7 @@ export default {
color: '#000000', color: '#000000',
alpha: 0.6 alpha: 0.6
}], }],
'--profileTint': '$alpha(--background, 0.5)' '--profileTint': 'color | $alpha(--background, 0.5)'
} }
}, },
{ {

View File

@ -661,7 +661,13 @@ export const init = (extraRuleset, palette) => {
} }
default: default:
if (k.startsWith('--')) { if (k.startsWith('--')) {
return k + ': ' + rgba2css(findColor(v, computed[selector].dynamicVars)) const [type, value] = v.split('|').map(x => x.trim()) // woah, Extreme!
switch (type) {
case 'color':
return k + ': ' + rgba2css(findColor(value, computed[selector].dynamicVars))
default:
return ''
}
} }
return '' return ''
} }