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