UNPKG

@fylgja/base

Version:

Base provides a streamlined starting point for any web project. It’s a collection of class-less solutions, allowing you to focus on building your site.

121 lines (104 loc) 2.61 kB
/** * Fylgja (https://fylgja.dev) * Licensed under MIT Open Source */ @view-transition { navigation: auto; } :root { --brand: hsl(260, 84%, 56%); --on-brand: hsl(260, 0%, 100%); --form-active-color: var(--brand); --form-error-color: #e00; --control-checked-stroke: var(--brand); --control-checked-bg: var(--brand); --control-checked-color: var(--on-brand); color-scheme: light dark; scrollbar-color: var(--scrollthumb-color, var(--brand)) var(--scrolltrack-color, var(--surface-color)); accent-color: var(--brand); caret-color: var(--brand); interpolate-size: allow-keywords; } @media (prefers-color-scheme: dark) { :root { --root-bg: color-mix(in oklab, hsl(0 15% 5%) 92%, var(--brand)); --root-fg: hsl(0 0% 98%); --select-icon: var(--select-dark-scheme); } } ::marker { color: var(--brand); font-weight: bolder; } ::selection { text-shadow: none; background: var(--brand); color: var(--on-brand); } :focus-visible { outline-color: var(--brand); } :where(:not(h1, h2, h3, h4, h5, h6, strong) > a) { font-weight: 500; } blockquote, hr { border-color: var(--brand); } :where(tbody tr:nth-child(even) :is(th, td)) { background: var(--table-even-bg, var(--surface-color)); } body { display: flex; flex-direction: column; } body > main { flex-grow: 1; } :where(body > :is(main, header, footer), article, section, aside) { container-type: inline-size; } ::-webkit-calendar-picker-indicator { outline-color: var(--brand); } :where(select option:checked) { background: var(--brand); color: var(--on-brand); } :where(:user-invalid:not(:focus), .input-group:has(:user-invalid):not(:focus-within)) { --form-stroke: var(--form-error-color); outline: 1px solid var(--form-stroke); } .field { display: block; } .field:where(:not(:last-child)) { margin-block-end: 1em; } .btn-primary, .btn:where(.--primary), :where([type=submit], form button:not([type])), ::file-selector-button { --btn-stroke: transparent; --btn-bg: var(--brand); --btn-color: var(--on-brand); --btn-hover-bg: color-mix(in oklab, var(--brand) 80%, #000); --btn-active-bg: color-mix(in oklab, var(--brand) 72%, #000); } :where([type=reset]) { --btn-color: var(--form-error-color, currentcolor); } :where(.btn, button, [type=button], [type=submit], [type=reset]):has(:where(svg:only-child, img:only-child)) { --btn-px: var(--btn-py, 0.375rem); } :where(dialog).offcanvas { --ty: 0; --tx: 100%; --screen-y: 0; --mx: auto 0; block-size: 100%; inline-size: min(100%, 25rem); border-start-end-radius: 0; border-end-end-radius: 0; }