mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-08-30 00:14:51 +02:00
Found [a better color picker](https://github.com/web-padawan/vanilla-colorful) that [does not rely](https://github.com/mdbassit/Coloris/issues/139) on `querySelectorAll` or a global shared instance, and is also around a third of the size of the previous one. The popover is handled by tippy.js for which I introduced a new "bare" theme and it uses a new sibling-based mechanism which should prove useful later to create tippy popovers via HTML only. <img width="846" alt="Screenshot 2024-03-31 at 04 03 38" src="https://github.com/go-gitea/gitea/assets/115237/7639b911-a2d7-4f5c-bffd-a9d84561e747"> (cherry picked from commit 1195be41a13d2198ab644c8558549edd74485510)
47 lines
1.1 KiB
CSS
47 lines
1.1 KiB
CSS
.js-color-picker-input {
|
|
display: flex;
|
|
position: relative;
|
|
}
|
|
|
|
.js-color-picker-input input {
|
|
padding-top: 8px !important;
|
|
padding-bottom: 8px !important;
|
|
padding-left: 32px !important;
|
|
}
|
|
|
|
.js-color-picker-input .preview-square {
|
|
position: absolute;
|
|
aspect-ratio: 1;
|
|
height: 16px;
|
|
left: 10px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
border-radius: 2px;
|
|
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 */
|
|
background-position: 0 0, 4px 4px;
|
|
background-size: 8px 8px;
|
|
}
|
|
|
|
.js-color-picker-input .preview-square::after {
|
|
content: "";
|
|
position: absolute;
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: inherit;
|
|
background-color: currentcolor;
|
|
}
|
|
|
|
hex-color-picker {
|
|
width: 180px;
|
|
height: 120px;
|
|
}
|
|
|
|
hex-color-picker::part(hue-pointer),
|
|
hex-color-picker::part(saturation-pointer) {
|
|
width: 22px;
|
|
height: 22px;
|
|
}
|
|
|
|
hex-color-picker::part(hue) {
|
|
flex-basis: 16px;
|
|
}
|