Files
2026-10-26 13:25:21 +08:00

63 lines
1.4 KiB
CSS

/* Adapted from HeroUI ce90ea3, Apache-2.0; see third-party/HEROUI-LICENSE. */
/* ==========================================================================
ColorSwatch - visual preview of a color with a transparency checkerboard
========================================================================== */
.hv-color-swatch {
@apply relative box-border size-8 shrink-0;
/* Checkered background pattern for transparency */
background:
linear-gradient(var(--color-swatch-current), var(--color-swatch-current)),
repeating-conic-gradient(#efefef 0% 25%, #f7f7f7 0% 50%) 50% / 16px 16px;
/* Default border for visibility against similar backgrounds */
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}
/* Shape variants */
.hv-color-swatch--circle {
@apply rounded-2xl;
}
.hv-color-swatch--square {
@apply rounded-md;
}
/* Size variants */
.hv-color-swatch--xs {
@apply size-4;
&.hv-color-swatch--circle {
@apply rounded-lg;
}
}
.hv-color-swatch--sm {
@apply size-6;
&.hv-color-swatch--circle {
@apply rounded-xl;
}
}
.hv-color-swatch--md {
/* No additional styles — default size (32px) uses circle's base rounded-2xl */
}
.hv-color-swatch--lg {
@apply size-9;
&.hv-color-swatch--circle {
@apply rounded-3xl;
}
}
.hv-color-swatch--xl {
@apply size-10;
&.hv-color-swatch--circle {
@apply rounded-3xl;
}
}