|
| 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 | + |
| 5 | +.js-color-picker-input { |
| 6 | + display: flex; |
| 7 | + flex-wrap: wrap; |
| 8 | +} |
| 9 | + |
| 10 | +.js-color-picker-input input { |
| 11 | + padding-top: 8px !important; |
| 12 | + padding-bottom: 8px !important; |
| 13 | + padding-left: 32px !important; |
| 14 | +} |
| 15 | + |
| 16 | +.clr-picker { |
| 17 | + display: none; |
| 18 | + flex-wrap: wrap; |
| 19 | + position: absolute; |
| 20 | + width: 200px; |
| 21 | + z-index: 1002; /* above .ui.modal which has 1001 */ |
| 22 | + border-radius: var(--border-radius); |
| 23 | + background-color: var(--color-menu); |
| 24 | + justify-content: flex-end; |
| 25 | + direction: ltr; |
| 26 | + box-shadow: 0 5px 20px var(--color-shadow); |
| 27 | + user-select: none; |
| 28 | +} |
| 29 | + |
| 30 | +.clr-picker.clr-open { |
| 31 | + display: flex; |
| 32 | +} |
| 33 | + |
| 34 | +.clr-gradient { |
| 35 | + position: relative; |
| 36 | + width: 100%; |
| 37 | + height: 100px; |
| 38 | + border-radius: 3px 3px 0 0; |
| 39 | + background: linear-gradient(rgba(0,0,0,0), #000), linear-gradient(90deg, #fff, currentcolor); /* stylelint-disable-line scale-unlimited/declaration-strict-value */ |
| 40 | + cursor: pointer; |
| 41 | +} |
| 42 | + |
| 43 | +.clr-marker { |
| 44 | + position: absolute; |
| 45 | + width: 12px; |
| 46 | + height: 12px; |
| 47 | + margin: -6px 0 0 -6px; |
| 48 | + border: 1px solid var(--color-white); |
| 49 | + border-radius: 50%; |
| 50 | + background-color: currentcolor; |
| 51 | + cursor: pointer; |
| 52 | +} |
| 53 | + |
| 54 | +.clr-picker input[type="range"]::-webkit-slider-runnable-track { |
| 55 | + width: 100%; |
| 56 | + height: 16px; |
| 57 | +} |
| 58 | + |
| 59 | +.clr-picker input[type="range"]::-webkit-slider-thumb { |
| 60 | + width: 16px; |
| 61 | + height: 16px; |
| 62 | + -webkit-appearance: none; |
| 63 | +} |
| 64 | + |
| 65 | +.clr-picker input[type="range"]::-moz-range-track { |
| 66 | + width: 100%; |
| 67 | + height: 16px; |
| 68 | + border: 0; |
| 69 | +} |
| 70 | + |
| 71 | +.clr-picker input[type="range"]::-moz-range-thumb { |
| 72 | + width: 16px; |
| 73 | + height: 16px; |
| 74 | + border: 0; |
| 75 | +} |
| 76 | + |
| 77 | +.clr-hue { |
| 78 | + 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 */ |
| 79 | + position: relative; |
| 80 | + width: calc(100% - 40px); |
| 81 | + height: 10px; |
| 82 | + margin: 10px 20px; |
| 83 | + border-radius: 4px; |
| 84 | +} |
| 85 | + |
| 86 | +.clr-hue input[type="range"] { |
| 87 | + position: absolute; |
| 88 | + width: calc(100% + 32px); |
| 89 | + margin: 0; |
| 90 | + background-color: transparent; |
| 91 | + opacity: 0; |
| 92 | + cursor: pointer; |
| 93 | + appearance: none; |
| 94 | +} |
| 95 | + |
| 96 | +.clr-hue div { |
| 97 | + position: absolute; |
| 98 | + width: 16px; |
| 99 | + height: 16px; |
| 100 | + left: 0; |
| 101 | + top: 50%; |
| 102 | + transform: translate(-50%, -50%); |
| 103 | + border: 2px solid var(--color-white); |
| 104 | + border-radius: 50%; |
| 105 | + background-color: currentcolor; |
| 106 | + box-shadow: 0 0 1px var(--color-shadow); |
| 107 | + pointer-events: none; |
| 108 | +} |
| 109 | + |
| 110 | +.clr-field { |
| 111 | + flex: 1; |
| 112 | + position: relative; |
| 113 | + color: transparent; |
| 114 | +} |
| 115 | + |
| 116 | +.clr-field button { |
| 117 | + position: absolute; |
| 118 | + aspect-ratio: 1; |
| 119 | + height: 16px; |
| 120 | + left: 10px; |
| 121 | + top: 50%; |
| 122 | + transform: translateY(-50%); |
| 123 | + margin: 0; |
| 124 | + padding: 0; |
| 125 | + border: 0; |
| 126 | + color: inherit; |
| 127 | + pointer-events: none; |
| 128 | + border-radius: 2px; |
| 129 | + 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 */ |
| 130 | + background-position: 0 0, 4px 4px; |
| 131 | + background-size: 8px 8px; |
| 132 | +} |
| 133 | + |
| 134 | +.clr-field button::after { |
| 135 | + content: ""; |
| 136 | + display: block; |
| 137 | + position: absolute; |
| 138 | + width: 100%; |
| 139 | + height: 100%; |
| 140 | + left: 0; |
| 141 | + top: 0; |
| 142 | + border-radius: inherit; |
| 143 | + background-color: currentcolor; |
| 144 | +} |
| 145 | + |
| 146 | +.clr-marker:focus { |
| 147 | + outline: none; |
| 148 | +} |
| 149 | + |
| 150 | +.clr-keyboard-nav .clr-marker:focus, |
| 151 | +.clr-keyboard-nav .clr-hue input:focus + div, |
| 152 | +.clr-keyboard-nav .clr-alpha input:focus + div { |
| 153 | + outline: none; |
| 154 | + box-shadow: 0 0 2px 2px var(--color-white); |
| 155 | +} |
| 156 | + |
| 157 | +.clr-picker .clr-preview, |
| 158 | +.clr-picker .clr-clear, |
| 159 | +.clr-picker .clr-swatches, |
| 160 | +.clr-picker .clr-format, |
| 161 | +.clr-picker .clr-alpha, |
| 162 | +.clr-picker .clr-color { |
| 163 | + display: none; |
| 164 | +} |
0 commit comments