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

99 lines
2.1 KiB
JavaScript
Raw Normal View History

export default {
name: 'Input',
selector: '.input',
2024-09-12 12:46:47 +03:00
states: {
hover: ':is(:hover, :focus-visible):not(.disabled)',
2024-09-12 12:46:47 +03:00
focused: ':focus-within',
2026-01-06 16:22:52 +02:00
disabled: '.disabled',
2024-09-12 12:46:47 +03:00
},
variants: {
2024-02-21 13:10:11 +02:00
checkbox: '.-checkbox',
2026-01-06 16:22:52 +02:00
radio: '.-radio',
2024-02-21 13:10:11 +02:00
},
2026-01-06 16:22:52 +02:00
validInnerComponents: ['Text', 'Icon'],
defaultRules: [
2024-02-21 22:18:56 +02:00
{
component: 'Root',
directives: {
2026-01-06 16:22:52 +02:00
'--defaultInputBevel':
'shadow | $borderSide(#FFFFFF bottom 0.2), $borderSide(#000000 top 0.2), inset 0 0 2 #000000 / 0.15, 1 0 1 1 --text / 0.15, -1 0 1 1 --text / 0.15',
2024-10-07 02:16:24 +03:00
'--defaultInputHoverGlow': 'shadow | 0 0 4 --text / 0.5',
2026-01-06 16:22:52 +02:00
'--defaultInputFocusGlow': 'shadow | 0 0 4 4 --link / 0.5',
},
2024-02-21 22:18:56 +02:00
},
2024-02-21 13:10:11 +02:00
{
variant: 'checkbox',
directives: {
2026-01-06 16:22:52 +02:00
roundness: 1,
},
2024-02-21 13:10:11 +02:00
},
{
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,
2026-01-06 16:22:52 +02:00
shadow: [
{
x: 0,
y: 0,
blur: 2,
spread: 0,
color: '#000000',
alpha: 1,
},
'--defaultInputBevel',
],
},
},
{
state: ['hover'],
directives: {
2026-01-06 16:22:52 +02:00
shadow: ['--defaultInputHoverGlow', '--defaultInputBevel'],
},
2024-10-03 00:12:40 +03:00
},
{
state: ['focused'],
directives: {
2026-01-06 16:22:52 +02:00
shadow: ['--defaultInputFocusGlow', '--defaultInputBevel'],
},
2024-10-03 00:12:40 +03:00
},
{
state: ['focused', 'hover'],
directives: {
2026-01-06 16:22:52 +02:00
shadow: [
'--defaultInputFocusGlow',
'--defaultInputHoverGlow',
'--defaultInputBevel',
],
},
2024-09-12 12:46:47 +03:00
},
{
state: ['disabled'],
directives: {
2026-01-06 16:22:52 +02:00
background: '--parent',
},
2024-09-12 12:46:47 +03:00
},
{
component: 'Text',
parent: {
component: 'Input',
2026-01-06 16:22:52 +02:00
state: ['disabled'],
2024-09-12 12:46:47 +03:00
},
directives: {
textOpacity: 0.25,
2026-01-06 16:22:52 +02:00
textOpacityMode: 'blend',
},
2024-09-12 12:46:47 +03:00
},
{
component: 'Icon',
parent: {
component: 'Input',
2026-01-06 16:22:52 +02:00
state: ['disabled'],
2024-09-12 12:46:47 +03:00
},
directives: {
textOpacity: 0.25,
2026-01-06 16:22:52 +02:00
textOpacityMode: 'blend',
},
},
],
}