logo

pleroma-fe

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

scrollbar_element.style.js (2043B)


  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. notEditable: true, // for now
  32. states: {
  33. pressed: ':active',
  34. hover: ':hover:not(:disabled)',
  35. disabled: ':disabled'
  36. },
  37. validInnerComponents: [
  38. 'Text'
  39. ],
  40. defaultRules: [
  41. {
  42. directives: {
  43. background: '--fg',
  44. shadow: [buttonOuterShadow, ...buttonInsetFakeBorders],
  45. roundness: 3
  46. }
  47. },
  48. {
  49. state: ['hover'],
  50. directives: {
  51. shadow: [hoverGlow, ...buttonInsetFakeBorders]
  52. }
  53. },
  54. {
  55. state: ['pressed'],
  56. directives: {
  57. shadow: [buttonOuterShadow, ...inputInsetFakeBorders]
  58. }
  59. },
  60. {
  61. state: ['hover', 'pressed'],
  62. directives: {
  63. shadow: [hoverGlow, ...inputInsetFakeBorders]
  64. }
  65. },
  66. {
  67. state: ['toggled'],
  68. directives: {
  69. background: '--accent,-24.2',
  70. shadow: [buttonOuterShadow, ...inputInsetFakeBorders]
  71. }
  72. },
  73. {
  74. state: ['toggled', 'hover'],
  75. directives: {
  76. background: '--accent,-24.2',
  77. shadow: [hoverGlow, ...inputInsetFakeBorders]
  78. }
  79. },
  80. {
  81. state: ['disabled'],
  82. directives: {
  83. background: '$blend(--inheritedBackground 0.25 --parent)',
  84. shadow: [...buttonInsetFakeBorders]
  85. }
  86. },
  87. {
  88. component: 'Text',
  89. parent: {
  90. component: 'Button',
  91. state: ['disabled']
  92. },
  93. directives: {
  94. textOpacity: 0.25,
  95. textOpacityMode: 'blend'
  96. }
  97. }
  98. ]
  99. }