You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

colorpicker.css 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /* This is a stripped-down version of coloris's CSS tailored to our needs. It does only include
  2. opaqua colors, and if more features like opacity are needed, the CSS needs to be extended
  3. based on upstream: https://github.com/mdbassit/Coloris/blob/main/src/coloris.css. */
  4. .js-color-picker-input {
  5. display: flex;
  6. flex-wrap: wrap;
  7. }
  8. .js-color-picker-input input {
  9. padding-top: 8px !important;
  10. padding-bottom: 8px !important;
  11. padding-left: 32px !important;
  12. }
  13. .clr-picker {
  14. display: none;
  15. flex-wrap: wrap;
  16. position: absolute;
  17. width: 200px;
  18. z-index: 1002; /* above .ui.modal which has 1001 */
  19. border-radius: var(--border-radius);
  20. background-color: var(--color-menu);
  21. justify-content: flex-end;
  22. direction: ltr;
  23. box-shadow: 0 5px 20px var(--color-shadow);
  24. user-select: none;
  25. }
  26. .clr-picker.clr-open {
  27. display: flex;
  28. }
  29. .clr-gradient {
  30. position: relative;
  31. width: 100%;
  32. height: 100px;
  33. border-radius: 3px 3px 0 0;
  34. background: linear-gradient(rgba(0,0,0,0), #000), linear-gradient(90deg, #fff, currentcolor); /* stylelint-disable-line scale-unlimited/declaration-strict-value */
  35. cursor: pointer;
  36. }
  37. .clr-marker {
  38. position: absolute;
  39. width: 12px;
  40. height: 12px;
  41. margin: -6px 0 0 -6px;
  42. border: 1px solid var(--color-white);
  43. border-radius: 50%;
  44. background-color: currentcolor;
  45. cursor: pointer;
  46. }
  47. .clr-picker input[type="range"]::-webkit-slider-runnable-track {
  48. width: 100%;
  49. height: 16px;
  50. }
  51. .clr-picker input[type="range"]::-webkit-slider-thumb {
  52. width: 16px;
  53. height: 16px;
  54. -webkit-appearance: none;
  55. }
  56. .clr-picker input[type="range"]::-moz-range-track {
  57. width: 100%;
  58. height: 16px;
  59. border: 0;
  60. }
  61. .clr-picker input[type="range"]::-moz-range-thumb {
  62. width: 16px;
  63. height: 16px;
  64. border: 0;
  65. }
  66. .clr-hue {
  67. background: linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%); /* stylelint-disable-line scale-unlimited/declaration-strict-value */
  68. position: relative;
  69. width: calc(100% - 40px);
  70. height: 10px;
  71. margin: 10px 20px;
  72. border-radius: 4px;
  73. }
  74. .clr-hue input[type="range"] {
  75. position: absolute;
  76. width: calc(100% + 32px);
  77. margin: 0;
  78. background-color: transparent;
  79. opacity: 0;
  80. cursor: pointer;
  81. appearance: none;
  82. }
  83. .clr-hue div {
  84. position: absolute;
  85. width: 16px;
  86. height: 16px;
  87. left: 0;
  88. top: 50%;
  89. transform: translate(-50%, -50%);
  90. border: 2px solid var(--color-white);
  91. border-radius: 50%;
  92. background-color: currentcolor;
  93. box-shadow: 0 0 1px var(--color-shadow);
  94. pointer-events: none;
  95. }
  96. .clr-field {
  97. flex: 1;
  98. position: relative;
  99. color: transparent;
  100. }
  101. .clr-field button {
  102. position: absolute;
  103. aspect-ratio: 1;
  104. height: 16px;
  105. left: 10px;
  106. top: 50%;
  107. transform: translateY(-50%);
  108. margin: 0;
  109. padding: 0;
  110. border: 0;
  111. color: inherit;
  112. pointer-events: none;
  113. border-radius: 2px;
  114. background: repeating-linear-gradient(45deg, #aaa 25%, transparent 25%, transparent 75%, #aaa 75%, #aaa), repeating-linear-gradient(45deg, #aaa 25%, #fff 25%, #fff 75%, #aaa 75%, #aaa); /* stylelint-disable-line scale-unlimited/declaration-strict-value */
  115. background-position: 0 0, 4px 4px;
  116. background-size: 8px 8px;
  117. }
  118. .clr-field button::after {
  119. content: "";
  120. display: block;
  121. position: absolute;
  122. width: 100%;
  123. height: 100%;
  124. left: 0;
  125. top: 0;
  126. border-radius: inherit;
  127. background-color: currentcolor;
  128. }
  129. .clr-marker:focus {
  130. outline: none;
  131. }
  132. .clr-keyboard-nav .clr-marker:focus,
  133. .clr-keyboard-nav .clr-hue input:focus + div,
  134. .clr-keyboard-nav .clr-alpha input:focus + div {
  135. outline: none;
  136. box-shadow: 0 0 2px 2px var(--color-white);
  137. }
  138. .clr-picker .clr-preview,
  139. .clr-picker .clr-clear,
  140. .clr-picker .clr-swatches,
  141. .clr-picker .clr-format,
  142. .clr-picker .clr-alpha,
  143. .clr-picker .clr-color {
  144. display: none;
  145. }