icon-button.css 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. [data-component="icon-button"] {
  2. display: inline-flex;
  3. align-items: center;
  4. justify-content: center;
  5. border-radius: var(--radius-sm);
  6. text-decoration: none;
  7. user-select: none;
  8. aspect-ratio: 1;
  9. flex-shrink: 0;
  10. &[data-variant="primary"] {
  11. background-color: var(--icon-strong-base);
  12. [data-slot="icon"] {
  13. /* color: var(--icon-weak-base); */
  14. color: var(--icon-invert-base);
  15. /* &:hover:not(:disabled) { */
  16. /* color: var(--icon-weak-hover); */
  17. /* } */
  18. /* &:active:not(:disabled) { */
  19. /* color: var(--icon-string-active); */
  20. /* } */
  21. }
  22. &:hover:not(:disabled) {
  23. background-color: var(--icon-strong-hover);
  24. }
  25. &:focus:not(:disabled) {
  26. background-color: var(--icon-strong-focus);
  27. }
  28. &:active:not(:disabled) {
  29. background-color: var(--icon-string-active);
  30. }
  31. &:disabled {
  32. background-color: var(--icon-strong-disabled);
  33. [data-slot="icon"] {
  34. color: var(--icon-invert-base);
  35. }
  36. }
  37. }
  38. &[data-variant="secondary"] {
  39. border: transparent;
  40. background-color: var(--button-secondary-base);
  41. color: var(--text-strong);
  42. box-shadow: var(--shadow-xs-border);
  43. &:hover:not(:disabled) {
  44. background-color: var(--button-secondary-hover);
  45. }
  46. &:focus:not(:disabled) {
  47. background-color: var(--button-secondary-base);
  48. }
  49. &:focus-visible:not(:active) {
  50. background-color: var(--button-secondary-base);
  51. box-shadow: var(--shadow-xs-border-focus);
  52. }
  53. &:focus-visible:active {
  54. box-shadow: none;
  55. }
  56. &:active:not(:disabled) {
  57. background-color: var(--button-secondary-base);
  58. }
  59. [data-slot="icon"] {
  60. color: var(--icon-strong-base);
  61. }
  62. }
  63. &[data-variant="ghost"] {
  64. background-color: transparent;
  65. /* color: var(--icon-base); */
  66. [data-slot="icon"] {
  67. color: var(--icon-base);
  68. }
  69. &:hover:not(:disabled) {
  70. background-color: var(--surface-raised-base-hover);
  71. /* [data-slot="icon"] { */
  72. /* color: var(--icon-hover); */
  73. /* } */
  74. }
  75. &:focus:not(:disabled) {
  76. background-color: var(--surface-focus);
  77. }
  78. &:active:not(:disabled) {
  79. background-color: var(--surface-raised-base-active);
  80. /* [data-slot="icon"] { */
  81. /* color: var(--icon-active); */
  82. /* } */
  83. }
  84. &:selected:not(:disabled) {
  85. background-color: var(--surface-raised-base-active);
  86. /* [data-slot="icon"] { */
  87. /* color: var(--icon-selected); */
  88. /* } */
  89. }
  90. }
  91. &[data-size="normal"] {
  92. width: 24px;
  93. height: 24px;
  94. font-size: var(--font-size-small);
  95. line-height: var(--line-height-large);
  96. gap: calc(var(--spacing) * 0.5);
  97. }
  98. &[data-size="large"] {
  99. height: 32px;
  100. /* padding: 0 8px 0 6px; */
  101. gap: 8px;
  102. [data-slot="icon"] {
  103. height: 16px;
  104. width: 16px;
  105. }
  106. /* text-12-medium */
  107. font-family: var(--font-family-sans);
  108. font-size: var(--font-size-small);
  109. font-style: normal;
  110. font-weight: var(--font-weight-medium);
  111. line-height: var(--line-height-large); /* 166.667% */
  112. letter-spacing: var(--letter-spacing-normal);
  113. }
  114. &:disabled {
  115. background-color: var(--icon-strong-disabled);
  116. color: var(--icon-invert-base);
  117. cursor: not-allowed;
  118. }
  119. &:focus {
  120. outline: none;
  121. }
  122. }