ToolIcon.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. :root {
  2. --button-gray-1: #e9ecef;
  3. --button-gray-2: #ced4da;
  4. --button-gray-3: #adb5bd;
  5. --button-blue: #a5d8ff;
  6. }
  7. .ToolIcon {
  8. display: inline-flex;
  9. align-items: center;
  10. position: relative;
  11. font-family: Cascadia;
  12. cursor: pointer;
  13. background-color: var(--button-gray-1);
  14. -webkit-tap-highlight-color: transparent;
  15. border-radius: var(--space-factor);
  16. }
  17. .ToolIcon__icon {
  18. width: 2.5rem;
  19. height: 2.5rem;
  20. display: flex;
  21. justify-content: center;
  22. align-items: center;
  23. border-radius: var(--space-factor);
  24. svg {
  25. position: relative;
  26. height: 1em;
  27. }
  28. & + .ToolIcon__label {
  29. margin-left: 0;
  30. }
  31. }
  32. .ToolIcon__label {
  33. font-family: var(--ui-font);
  34. margin: 0 0.8em;
  35. text-overflow: ellipsis;
  36. }
  37. .ToolIcon_size_s .ToolIcon__icon {
  38. width: 1.4rem;
  39. height: 1.4rem;
  40. font-size: 0.8em;
  41. }
  42. .ToolIcon_type_button {
  43. padding: 0;
  44. border: none;
  45. margin: 0;
  46. font-size: inherit;
  47. &:hover {
  48. background-color: var(--button-gray-1);
  49. }
  50. &:active {
  51. background-color: var(--button-gray-2);
  52. }
  53. &:focus {
  54. box-shadow: 0 0 0 2px var(--button-blue);
  55. }
  56. &.ToolIcon--selected {
  57. background-color: var(--button-gray-2);
  58. &:active {
  59. background-color: var(--button-gray-3);
  60. }
  61. }
  62. }
  63. .ToolIcon_type_radio,
  64. .ToolIcon_type_checkbox {
  65. position: absolute;
  66. opacity: 0;
  67. pointer-events: none;
  68. &:checked + .ToolIcon__icon {
  69. background-color: var(--button-gray-2);
  70. }
  71. &:focus + .ToolIcon__icon {
  72. box-shadow: 0 0 0 2px var(--button-blue);
  73. }
  74. &:active + .ToolIcon__icon {
  75. background-color: var(--button-gray-3);
  76. }
  77. }
  78. .ToolIcon_type_floating {
  79. background-color: transparent;
  80. &:hover {
  81. background-color: transparent;
  82. }
  83. &:active {
  84. background-color: transparent;
  85. }
  86. &:focus {
  87. box-shadow: none;
  88. }
  89. .ToolIcon__icon {
  90. width: 2rem;
  91. height: 2em;
  92. }
  93. }
  94. .ToolIcon.ToolIcon__lock {
  95. &.ToolIcon_type_floating {
  96. margin-left: 0.1rem;
  97. }
  98. }
  99. .ToolIcon__keybinding {
  100. position: absolute;
  101. bottom: 2px;
  102. right: 3px;
  103. font-size: 0.5em;
  104. color: var(--button-gray-3); // OC GRAY 5
  105. font-family: var(--ui-font);
  106. user-select: none;
  107. }
  108. @media (max-width: 360px) {
  109. .ToolIcon.ToolIcon__lock {
  110. display: inline-block;
  111. position: absolute;
  112. top: 60px;
  113. right: -8px;
  114. margin-left: 0;
  115. border-radius: 20px 0 0 20px;
  116. background-color: var(--button-gray-1);
  117. &:hover {
  118. background-color: var(--button-gray-1);
  119. }
  120. &:active {
  121. background-color: var(--button-gray-2);
  122. }
  123. .ToolIcon__icon {
  124. width: 2.5rem;
  125. height: 2.5rem;
  126. border-radius: inherit;
  127. }
  128. svg {
  129. position: static;
  130. }
  131. }
  132. }
  133. .unlocked-icon {
  134. :root[dir="ltr"] & {
  135. left: 2px;
  136. }
  137. :root[dir="rtl"] & {
  138. right: 2px;
  139. }
  140. }