logo

pleroma-fe

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

scrollbar_element.style.js (2013B)


  1. const border = (top, shadow) => ({
  2. x: 0,
  3. y: top ? 1 : -1,
  4. blur: 0,
  5. spread: 0,
  6. color: shadow ? '#000000' : '#FFFFFF',
  7. alpha: 0.2,
  8. inset: true
  9. })
  10. const buttonInsetFakeBorders = [border(true, false), border(false, true)]
  11. const inputInsetFakeBorders = [border(true, true), border(false, false)]
  12. const buttonOuterShadow = {
  13. x: 0,
  14. y: 0,
  15. blur: 2,
  16. spread: 0,
  17. color: '#000000',
  18. alpha: 1
  19. }
  20. const hoverGlow = {
  21. x: 0,
  22. y: 0,
  23. blur: 4,
  24. spread: 0,
  25. color: '--text',
  26. alpha: 1
  27. }
  28. export default {
  29. name: 'ScrollbarElement',
  30. selector: '::-webkit-scrollbar-button',
  31. states: {
  32. pressed: ':active',
  33. hover: ':hover:not(:disabled)',
  34. disabled: ':disabled'
  35. },
  36. validInnerComponents: [
  37. 'Text'
  38. ],
  39. defaultRules: [
  40. {
  41. directives: {
  42. background: '--fg',
  43. shadow: [buttonOuterShadow, ...buttonInsetFakeBorders],
  44. roundness: 3
  45. }
  46. },
  47. {
  48. state: ['hover'],
  49. directives: {
  50. shadow: [hoverGlow, ...buttonInsetFakeBorders]
  51. }
  52. },
  53. {
  54. state: ['pressed'],
  55. directives: {
  56. shadow: [buttonOuterShadow, ...inputInsetFakeBorders]
  57. }
  58. },
  59. {
  60. state: ['hover', 'pressed'],
  61. directives: {
  62. shadow: [hoverGlow, ...inputInsetFakeBorders]
  63. }
  64. },
  65. {
  66. state: ['toggled'],
  67. directives: {
  68. background: '--accent,-24.2',
  69. shadow: [buttonOuterShadow, ...inputInsetFakeBorders]
  70. }
  71. },
  72. {
  73. state: ['toggled', 'hover'],
  74. directives: {
  75. background: '--accent,-24.2',
  76. shadow: [hoverGlow, ...inputInsetFakeBorders]
  77. }
  78. },
  79. {
  80. state: ['disabled'],
  81. directives: {
  82. background: '$blend(--inheritedBackground, 0.25, --parent)',
  83. shadow: [...buttonInsetFakeBorders]
  84. }
  85. },
  86. {
  87. component: 'Text',
  88. parent: {
  89. component: 'Button',
  90. state: ['disabled']
  91. },
  92. directives: {
  93. textOpacity: 0.25,
  94. textOpacityMode: 'blend'
  95. }
  96. }
  97. ]
  98. }