fix unstyled buttons focus+active+hover styles

This commit is contained in:
Henry Jameson 2024-03-06 17:42:09 +02:00
parent 7df207c9d4
commit 7d1e787f55
1 changed files with 26 additions and 18 deletions

View File

@ -2,10 +2,10 @@ export default {
name: 'ButtonUnstyled', name: 'ButtonUnstyled',
selector: '.button-unstyled', selector: '.button-unstyled',
states: { states: {
toggled: '.toggled',
disabled: ':disabled', disabled: ':disabled',
hover: ':hover:not(:disabled)', hover: ':hover:not(:disabled)',
focused: ':focus-within', focused: ':focus-within'
toggled: '.toggled'
}, },
validInnerComponents: [ validInnerComponents: [
'Text', 'Text',
@ -41,29 +41,37 @@ export default {
} }
}, },
{ {
component: 'Text', component: 'Icon',
parent: { parent: {
component: 'ButtonUnstyled', component: 'ButtonUnstyled',
state: ['disabled'] state: ['toggled', 'hover']
}, },
directives: { directives: {
textOpacity: 0.25, textColor: '--parent--text'
textOpacityMode: 'blend'
}
},
{
component: 'Text',
parent: {
component: 'ButtonUnstyled',
state: ['disabled', 'hover']
},
directives: {
textOpacity: 0.25,
textOpacityMode: 'blend'
} }
}, },
{ {
component: 'Icon', component: 'Icon',
parent: {
component: 'ButtonUnstyled',
state: ['toggled', 'focused']
},
directives: {
textColor: '--parent--text'
}
},
{
component: 'Icon',
parent: {
component: 'ButtonUnstyled',
state: ['toggled', 'focused', 'hover']
},
directives: {
textColor: '--parent--text'
}
},
{
component: 'Text',
parent: { parent: {
component: 'ButtonUnstyled', component: 'ButtonUnstyled',
state: ['disabled'] state: ['disabled']
@ -77,7 +85,7 @@ export default {
component: 'Icon', component: 'Icon',
parent: { parent: {
component: 'ButtonUnstyled', component: 'ButtonUnstyled',
state: ['disabled', 'hover'] state: ['disabled']
}, },
directives: { directives: {
textOpacity: 0.25, textOpacity: 0.25,