i'm stupid

This commit is contained in:
Henry Jameson 2024-02-19 00:10:10 +02:00
parent f0bbb75df5
commit 6811191147
3 changed files with 11 additions and 26 deletions

View File

@ -1,23 +0,0 @@
export default {
name: 'Attachment',
selector: '.Attachment',
validInnerComponents: [
'Border',
'ButtonUnstyled'
],
defaultRules: [
{
directives: {
roundness: 3
}
},
{
component: 'ButtonUnstyled',
parent: { component: 'Attachment' },
directives: {
background: '#FFFFFF',
opacity: 0.9
}
}
]
}

View File

@ -10,6 +10,14 @@ export default {
directives: {
roundness: 3
}
},
{
component: 'ButtonUnstyled',
parent: { component: 'Attachment' },
directives: {
background: '#FFFFFF',
opacity: 0.5
}
}
]
}

View File

@ -169,6 +169,7 @@ export const init = (extraRuleset, palette) => {
return rule
})
console.log(rulesetUnsorted)
const ruleset = rulesetUnsorted
.map((data, index) => ({ data, index }))
@ -187,6 +188,8 @@ export const init = (extraRuleset, palette) => {
})
.map(({ data }) => data)
console.log(ruleset.filter(c => c.component === 'ButtonUnstyled'))
const virtualComponents = new Set(Object.values(components).filter(c => c.virtual).map(c => c.name))
const findColor = (color, dynamicVars) => {
@ -196,8 +199,6 @@ export const init = (extraRuleset, palette) => {
const [variable, modifier] = color.split(/,/g).map(str => str.trim())
const variableSlot = variable.substring(2)
if (variableSlot === 'stack') {
console.log(dynamicVars)
console.log(stacked)
const { r, g, b } = dynamicVars.stacked
targetColor = { r, g, b }
} else if (variableSlot.startsWith('parent')) {
@ -660,7 +661,6 @@ export const init = (extraRuleset, palette) => {
}
default:
if (k.startsWith('--')) {
console.log('LOL', k, rgba2css(findColor(v, computed[selector].dynamicVars)))
return k + ': ' + rgba2css(findColor(v, computed[selector].dynamicVars))
}
return ''