pleroma-fe/src/components/input.style.js

89 lines
1.6 KiB
JavaScript
Raw Normal View History

const hoverGlow = {
x: 0,
y: 0,
blur: 4,
spread: 0,
color: '--text',
alpha: 1
}
export default {
name: 'Input',
selector: '.input',
2024-09-12 12:46:47 +03:00
states: {
hover: ':hover:not(.disabled)',
focused: ':focus-within',
disabled: '.disabled'
},
variants: {
2024-02-21 13:10:11 +02:00
checkbox: '.-checkbox',
radio: '.-radio'
},
validInnerComponents: [
2024-09-12 12:46:47 +03:00
'Text',
'Icon'
],
defaultRules: [
2024-02-21 22:18:56 +02:00
{
component: 'Root',
directives: {
'--defaultInputBevel': 'shadow | $borderSide(#FFFFFF bottom 0.2), $borderSide(#000000 top 0.2)'
2024-02-21 22:18:56 +02:00
}
},
2024-02-21 13:10:11 +02:00
{
variant: 'checkbox',
directives: {
roundness: 1
}
},
{
directives: {
2024-02-22 18:04:28 +02:00
'--font': 'generic | inherit',
background: '--fg, -5',
2024-02-13 02:09:43 +02:00
roundness: 3,
shadow: [{
x: 0,
y: 0,
blur: 2,
spread: 0,
color: '#000000',
alpha: 1
2024-02-21 22:18:56 +02:00
}, '--defaultInputBevel']
}
},
{
state: ['hover'],
directives: {
2024-02-21 22:18:56 +02:00
shadow: [hoverGlow, '--defaultInputBevel']
}
2024-09-12 12:46:47 +03:00
},
{
state: ['disabled'],
directives: {
background: '--parent'
2024-09-12 12:46:47 +03:00
}
},
{
component: 'Text',
parent: {
component: 'Input',
state: ['disabled']
},
directives: {
textOpacity: 0.25,
textOpacityMode: 'blend'
}
},
{
component: 'Icon',
parent: {
component: 'Input',
state: ['disabled']
},
directives: {
textOpacity: 0.25,
textOpacityMode: 'blend'
}
}
]
}