logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

input.style.js (2033B)


  1. export default {
  2. name: 'Input',
  3. selector: '.input',
  4. states: {
  5. hover: ':hover:not(.disabled)',
  6. focused: ':focus-within',
  7. disabled: '.disabled'
  8. },
  9. variants: {
  10. checkbox: '.-checkbox',
  11. radio: '.-radio'
  12. },
  13. validInnerComponents: [
  14. 'Text',
  15. 'Icon'
  16. ],
  17. defaultRules: [
  18. {
  19. component: 'Root',
  20. directives: {
  21. '--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',
  22. '--defaultInputHoverGlow': 'shadow | 0 0 4 --text / 0.5',
  23. '--defaultInputFocusGlow': 'shadow | 0 0 4 4 --link / 0.5'
  24. }
  25. },
  26. {
  27. variant: 'checkbox',
  28. directives: {
  29. roundness: 1
  30. }
  31. },
  32. {
  33. directives: {
  34. '--font': 'generic | inherit',
  35. background: '--fg, -5',
  36. roundness: 3,
  37. shadow: [{
  38. x: 0,
  39. y: 0,
  40. blur: 2,
  41. spread: 0,
  42. color: '#000000',
  43. alpha: 1
  44. }, '--defaultInputBevel']
  45. }
  46. },
  47. {
  48. state: ['hover'],
  49. directives: {
  50. shadow: ['--defaultInputHoverGlow', '--defaultInputBevel']
  51. }
  52. },
  53. {
  54. state: ['focused'],
  55. directives: {
  56. shadow: ['--defaultInputFocusGlow', '--defaultInputBevel']
  57. }
  58. },
  59. {
  60. state: ['focused', 'hover'],
  61. directives: {
  62. shadow: ['--defaultInputFocusGlow', '--defaultInputHoverGlow', '--defaultInputBevel']
  63. }
  64. },
  65. {
  66. state: ['disabled'],
  67. directives: {
  68. background: '--parent'
  69. }
  70. },
  71. {
  72. component: 'Text',
  73. parent: {
  74. component: 'Input',
  75. state: ['disabled']
  76. },
  77. directives: {
  78. textOpacity: 0.25,
  79. textOpacityMode: 'blend'
  80. }
  81. },
  82. {
  83. component: 'Icon',
  84. parent: {
  85. component: 'Input',
  86. state: ['disabled']
  87. },
  88. directives: {
  89. textOpacity: 0.25,
  90. textOpacityMode: 'blend'
  91. }
  92. }
  93. ]
  94. }