Something went wrong. Try again.
UIKit a SolidJS component library inspired by Google's Material 3 Expressive
Something went wrong. Try again.
4.6 kB · 229 lines
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230.background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; user-select: none; background: transparent; z-index: 20;}
.root { position: fixed; display: flex; flex-direction: column; transform-origin: top left; animation: animateIn 100ms var(--uk-sys-motion-easing-standard-decelerate) forwards; z-index: 21;
&[data-align="left"] { transform-origin: top left; }
&[data-align="right"] { transform-origin: top right; }
@keyframes animateIn { from { transform: scaleY(95%) scaleX(95%); } to { transform: scaleY(100%) scaleX(100%); } }}
.button { position: relative; padding-left: 12px; padding-right: 12px; border-radius: 0.25rem; border: none; height: 2.75rem; margin-bottom: 0.125rem; background: transparent; color: rgb(var(--uk-sys-color-on-surface)); display: flex; flex-direction: row; align-items: center; justify-content: start; gap: 8px;
.icon { --icon-size: 20px; }
&::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: transparent; border-radius: 4px; }
&:hover { &::after { background-color: rgb(var(--uk-sys-color-on-surface), var(--uk-sys-state-hover-state-layer-opacity)); } }
&::before { content: ""; position: absolute; left: -0.125rem; top: 0; width: calc(100% + 0.25rem); height: calc(100% + 0.25rem); background: rgb(var(--uk-sys-color-surface-container-low)); z-index: -1; }
// is next element a spacer &:has(+ .spacer) { &::before { top: 0; border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem; height: calc(100% + 0.125rem); }
border-bottom-left-radius: 0.375rem; border-bottom-right-radius: 0.375rem; margin-bottom: 0.25rem;
&::after { border-bottom-left-radius: 0.375rem; border-bottom-right-radius: 0.375rem; } }
// is previous element a spacer .spacer + & { &::before { border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; top: -0.125rem; height: calc(100% + 0.25rem); }
border-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem; margin-top: 0.125rem;
&::after { border-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem; } }
&:last-of-type { &::before { border-bottom-left-radius: 1rem; border-bottom-right-radius: 1rem; height: calc(100% + 0.125rem); }
border-bottom-left-radius: 0.875rem; border-bottom-right-radius: 0.875rem; margin-bottom: 0.25rem;
&::after { border-bottom-left-radius: 0.875rem; border-bottom-right-radius: 0.875rem; } }
&:first-of-type { &::before { border-top-left-radius: 1rem; border-top-right-radius: 1rem; top: -0.125rem; height: calc(100% + 0.25rem); }
border-top-left-radius: 0.875rem; border-top-right-radius: 0.875rem; margin-top: 0.125rem;
&::after { border-top-left-radius: 0.875rem; border-top-right-radius: 0.875rem; } }
.selected { background-color: rgb(var(--uk-sys-color-tertiary)); color: rgb(var(--uk-sys-color-on-tertiary)); border-radius: 0.75rem !important; }
.text { width: 100%; display: flex; flex-direction: column; justify-content: center;
.label { }
.supportingText { color: rgb(var(--uk-sys-color-on-surface-variant)); } }}
.divider { position: relative; margin-bottom: 2px; background-color: rgb(var(--uk-sys-color-on-surface));
&::before { content: ""; position: absolute; left: -4px; top: 0; width: calc(100% + 8px); height: 100%; background: rgb(var(--uk-sys-color-surface)); z-index: -1; outline: 0.5px solid pink; }}
.root[data-vibrant="true"] { .button { color: rgb(var(--uk-sys-color-on-tertiary-container));
&::after { background-color: transparent; }
&:hover { &::after { background-color: rgb(var(--uk-sys-color-on-tertiary-container), var(--uk-sys-state-hover-state-layer-opacity)); } }
.selected { background-color: rgb(var(--uk-sys-color-tertiary)); color: rgb(var(--uk-sys-color-on-tertiary)); }
&::before { background: rgb(var(--uk-sys-color-tertiary-container)); } }
.divider { background-color: rgb(var(--uk-sys-color-on-tertiary-container));
&::before { background: rgb(var(--uk-sys-color-tertiary-container)); } }}