Add utility-first CSS layer and expand component library
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## 0.5.0
|
||||
|
||||
- Added a generated utility layer for layout, spacing, typography, colors, borders, shadows, responsive breakpoints, and interaction states.
|
||||
- Added standalone package exports for tokens, components, utilities, and base styles.
|
||||
- Added navbar, breadcrumbs, tabs, accordion, pagination, table, and spinner primitives.
|
||||
- Added semantic link, code, disabled, font-size, and breakpoint tokens.
|
||||
- Expanded the example page and validation checks for the public API.
|
||||
|
||||
## 0.4.0
|
||||
|
||||
- Added semantic success, danger, warning, backdrop, popover, and toast tokens.
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
# Frost CSS Framework
|
||||
# Frost
|
||||
|
||||
Frost is a small, semantic CSS foundation for personal websites and web applications. It provides tokens, accessible base styles, layout primitives, controls, and a few common components without trying to replace Bootstrap or Tailwind.
|
||||
Frost ist eine kleine CSS-Basis für persönliche Websites und Web-Apps. Sie bringt Tokens, zugängliche Grundstyles, Utility-Klassen, Layout-Helfer, Controls und fertige Komponenten mit. Du kannst Frost also entweder eher wie Tailwind mit einzelnen Utilities oder eher wie Bootstrap mit Komponenten verwenden.
|
||||
|
||||
## Installation
|
||||
## Einbinden
|
||||
|
||||
For a static site:
|
||||
Frost hat bewusst getrennte Schichten:
|
||||
|
||||
- `@fretuks/frost/core`: Tokens, Reset und Accessibility-Grundlagen
|
||||
- `@fretuks/frost/utility-layer`: Core plus Layout- und Utility-first-Klassen
|
||||
- `@fretuks/frost/component-layer`: Core plus Controls und fertige Komponenten
|
||||
- `@fretuks/frost`: alle Schichten zusammen
|
||||
|
||||
Für eine statische Website:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="frost/frost.css">
|
||||
```
|
||||
|
||||
For a CSS-aware build:
|
||||
Mit einem CSS-Build-Tool:
|
||||
|
||||
```css
|
||||
@import "./frost/frost.css";
|
||||
```
|
||||
|
||||
For npm-based projects:
|
||||
In einem npm-Projekt:
|
||||
|
||||
```bash
|
||||
npm install @fretuks/frost
|
||||
@@ -26,28 +33,87 @@ npm install @fretuks/frost
|
||||
@import "@fretuks/frost";
|
||||
```
|
||||
|
||||
## Basic usage
|
||||
Für die Utility-Schicht:
|
||||
|
||||
```css
|
||||
@import "@fretuks/frost/utility-layer";
|
||||
```
|
||||
|
||||
Für die Komponenten-Schicht:
|
||||
|
||||
```css
|
||||
@import "@fretuks/frost/component-layer";
|
||||
```
|
||||
|
||||
## Grundlegende Nutzung
|
||||
|
||||
```html
|
||||
<main class="frost-container frost-stack">
|
||||
<section class="frost-card frost-card--elevated">
|
||||
<h1>Welcome to Frost</h1>
|
||||
<p class="frost-text-muted">A compact foundation for reusable interfaces.</p>
|
||||
<a class="frost-button frost-button--primary" href="/start">Get started</a>
|
||||
<h1>Willkommen bei Frost</h1>
|
||||
<p class="frost-text-muted">Eine kleine Basis für wiederverwendbare Interfaces.</p>
|
||||
<a class="frost-button frost-button--primary" href="/start">Los geht's</a>
|
||||
</section>
|
||||
</main>
|
||||
```
|
||||
|
||||
## Utilities
|
||||
|
||||
Die Utility-Klassen folgen einem einfachen Muster und lassen sich kombinieren:
|
||||
|
||||
```html
|
||||
<section class="frost-grid frost-gap-6 frost-md:grid-cols-2">
|
||||
<article class="frost-bg-surface frost-border frost-rounded frost-p-6 frost-shadow-sm">
|
||||
<h2 class="frost-text-xl frost-font-bold">Eine Karte</h2>
|
||||
<p class="frost-mt-2 frost-text-muted">Abstände, Farben und Layout direkt im Markup.</p>
|
||||
</article>
|
||||
</section>
|
||||
```
|
||||
|
||||
Ein paar häufige Utilities:
|
||||
|
||||
- Layout: `frost-flex`, `frost-grid`, `frost-flex-wrap`, `frost-items-center`, `frost-justify-between`
|
||||
- Abstände: `frost-gap-4`, `frost-p-6`, `frost-px-4`, `frost-mt-4`, `frost-mx-auto`
|
||||
- Typografie: `frost-text-sm`, `frost-text-xl`, `frost-font-semibold`, `frost-text-muted`
|
||||
- Farben: `frost-bg-surface`, `frost-bg-soft`, `frost-text-accent`, `frost-text-danger`
|
||||
- Oberfläche: `frost-border`, `frost-rounded`, `frost-shadow`, `frost-overflow-hidden`
|
||||
|
||||
Responsive Varianten verwenden die Breakpoints `md` ab `48rem` und `lg` ab `64rem`:
|
||||
|
||||
```html
|
||||
<div class="frost-grid frost-grid-cols-1 frost-md:grid-cols-2 frost-lg:grid-cols-3">
|
||||
...
|
||||
</div>
|
||||
```
|
||||
|
||||
Für einfache Zustände gibt es ebenfalls Varianten:
|
||||
|
||||
```html
|
||||
<a class="frost-text-accent frost-hover:text-accent frost-focus:ring" href="/profil">
|
||||
Zum Profil
|
||||
</a>
|
||||
```
|
||||
|
||||
Die Utility-Datei wird aus `scripts/generate-utilities.mjs` erzeugt. Wenn sich die gemeinsame Utility-API ändert:
|
||||
|
||||
```bash
|
||||
npm run generate:utilities
|
||||
```
|
||||
|
||||
Utilities verwenden immer den Präfix `frost-`. Responsive Varianten folgen dem Muster `frost-md:*` und `frost-lg:*`; Zustände verwenden `frost-hover:*`, `frost-focus:*` und `frost-active:*`. Die Utility-Schicht enthält keine fertigen Komponenten und kann unabhängig von der Komponenten-Schicht eingesetzt werden.
|
||||
|
||||
Zusätzliche Utilities sind unter anderem `frost-relative`, `frost-absolute`, `frost-grid-cols-3`, `frost-col-span-2`, `frost-space-y-4`, `frost-opacity-50`, `frost-z-10` und `frost-truncate`.
|
||||
|
||||
## Layout
|
||||
|
||||
```html
|
||||
<div class="frost-grid" style="--frost-grid-min: 14rem">
|
||||
<article class="frost-card">One</article>
|
||||
<article class="frost-card">Two</article>
|
||||
<article class="frost-card">Eins</article>
|
||||
<article class="frost-card">Zwei</article>
|
||||
</div>
|
||||
```
|
||||
|
||||
`frost-stack`, `frost-row`, and `frost-grid` expose local custom properties for gap customization:
|
||||
`frost-stack`, `frost-row` und `frost-grid` haben lokale Custom Properties für den Abstand:
|
||||
|
||||
```html
|
||||
<div class="frost-stack" style="--frost-stack-gap: var(--frost-space-8)">
|
||||
@@ -55,40 +121,40 @@ npm install @fretuks/frost
|
||||
</div>
|
||||
```
|
||||
|
||||
Compact and icon controls are available when a project needs smaller repeated actions:
|
||||
Für kleinere, wiederkehrende Aktionen gibt es kompakte Buttons und Icon-Buttons:
|
||||
|
||||
```html
|
||||
<button class="frost-button frost-button--secondary frost-button--sm">Edit</button>
|
||||
<button class="frost-button frost-button--ghost frost-button--icon" aria-label="Close">×</button>
|
||||
<button class="frost-button frost-button--secondary frost-button--sm">Bearbeiten</button>
|
||||
<button class="frost-button frost-button--ghost frost-button--icon" aria-label="Schließen">×</button>
|
||||
```
|
||||
|
||||
## Forms
|
||||
## Formulare
|
||||
|
||||
```html
|
||||
<label class="frost-field">
|
||||
<span class="frost-label">Email</span>
|
||||
<span class="frost-label">E-Mail</span>
|
||||
<input class="frost-input" type="email" autocomplete="email">
|
||||
<span class="frost-help">We will only use this for account notifications.</span>
|
||||
<span class="frost-help">Wird nur für Benachrichtigungen zum Account verwendet.</span>
|
||||
</label>
|
||||
```
|
||||
|
||||
## Themes
|
||||
|
||||
Without an explicit theme, Frost follows `prefers-color-scheme`. Explicit themes override that behavior:
|
||||
Ohne explizites Theme richtet sich Frost nach `prefers-color-scheme`. Ein explizites Theme überschreibt dieses Verhalten:
|
||||
|
||||
```html
|
||||
<html data-theme="dark">
|
||||
```
|
||||
|
||||
or:
|
||||
oder:
|
||||
|
||||
```html
|
||||
<html data-theme="light">
|
||||
```
|
||||
|
||||
Frost does not require JavaScript; a theme switcher can be added later by Iceberg or ordinary vanilla JavaScript.
|
||||
Frost braucht kein JavaScript. Ein Theme-Schalter kann später mit Iceberg oder ganz normalem Vanilla-JavaScript ergänzt werden.
|
||||
|
||||
Projects with additional themes should override Frost's semantic roles rather than reaching into component selectors:
|
||||
Wenn ein Projekt weitere Themes braucht, sollten die semantischen Rollen von Frost überschrieben werden – nicht die Component-Selektoren:
|
||||
|
||||
```css
|
||||
body.theme-blue {
|
||||
@@ -100,9 +166,9 @@ body.theme-blue {
|
||||
}
|
||||
```
|
||||
|
||||
`--frost-color-selection` and `--frost-color-overlay` are available for theme-specific selection and overlay colors. Frost's modal primitives provide visual structure only; opening, closing, focus management, and ARIA behavior remain application responsibilities.
|
||||
Für Theme-spezifische Auswahl- und Overlay-Farben gibt es `--frost-color-selection` und `--frost-color-overlay`. Die Modal-Styles kümmern sich nur um die Darstellung. Öffnen, Schließen, Fokusmanagement und ARIA-Verhalten bleiben Aufgabe der Anwendung.
|
||||
|
||||
Frost's tokens are semantic and intentionally overridable. Add an application theme by setting the roles on a wrapper or document root; component selectors do not need to be redefined:
|
||||
Die Tokens von Frost sind semantisch und können bewusst überschrieben werden. Ein Anwendungstheme lässt sich auf einem Wrapper oder dem Dokument-Root setzen; die Component-Selektoren müssen dafür nicht neu definiert werden:
|
||||
|
||||
```css
|
||||
[data-theme="ocean"] {
|
||||
@@ -119,54 +185,56 @@ Frost's tokens are semantic and intentionally overridable. Add an application th
|
||||
<div class="frost-backdrop" hidden></div>
|
||||
<section class="frost-modal" role="dialog" aria-modal="true" aria-labelledby="dialog-title" hidden>
|
||||
<div class="frost-modal__content">
|
||||
<header class="frost-modal__header"><h2 id="dialog-title">Confirm</h2></header>
|
||||
<div class="frost-modal__body">Continue?</div>
|
||||
<header class="frost-modal__header"><h2 id="dialog-title">Bestätigen</h2></header>
|
||||
<div class="frost-modal__body">Fortfahren?</div>
|
||||
<footer class="frost-modal__footer"><button class="frost-button frost-button--primary">OK</button></footer>
|
||||
</div>
|
||||
</section>
|
||||
```
|
||||
|
||||
## Menus, popovers, and feedback
|
||||
## Menüs, Popovers und Feedback
|
||||
|
||||
Frost supplies visual primitives while application code owns state, positioning updates, and keyboard behavior. Use native buttons, `aria-expanded`, `aria-controls`, and `hidden` so the same markup works with vanilla JavaScript or a framework:
|
||||
Frost liefert die visuellen Bausteine. Die Anwendung kümmert sich um Zustand, Positionierung und Tastaturverhalten. Am besten native Buttons, `aria-expanded`, `aria-controls` und `hidden` verwenden – dann funktioniert dasselbe Markup mit Vanilla-JavaScript oder einem Framework:
|
||||
|
||||
```html
|
||||
<div class="frost-dropdown">
|
||||
<button class="frost-button frost-button--secondary" aria-expanded="false" aria-controls="account-menu">Account</button>
|
||||
<div id="account-menu" class="frost-dropdown__menu" hidden>
|
||||
<a class="frost-dropdown__item" href="/profile">Profile</a>
|
||||
<button class="frost-dropdown__item" type="button">Sign out</button>
|
||||
<a class="frost-dropdown__item" href="/profile">Profil</a>
|
||||
<button class="frost-dropdown__item" type="button">Abmelden</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="frost-alert frost-alert--warning" role="alert">
|
||||
<strong class="frost-alert__title">Check your details</strong>
|
||||
<span class="frost-alert__body">Some fields need attention.</span>
|
||||
<strong class="frost-alert__title">Daten prüfen</strong>
|
||||
<span class="frost-alert__body">Ein paar Felder brauchen noch Aufmerksamkeit.</span>
|
||||
</div>
|
||||
|
||||
<div class="frost-toast-region" aria-live="polite" aria-atomic="true">
|
||||
<div class="frost-toast frost-toast--success" role="status">
|
||||
<span>Saved successfully.</span>
|
||||
<button class="frost-button frost-button--icon" aria-label="Dismiss">×</button>
|
||||
<span>Erfolgreich gespeichert.</span>
|
||||
<button class="frost-button frost-button--icon" aria-label="Schließen">×</button>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
Tooltips use `data-frost-tooltip` and should supplement, never replace, an accessible label:
|
||||
Tooltips verwenden `data-frost-tooltip` und sollten ein zugängliches Label ergänzen, niemals ersetzen:
|
||||
|
||||
```html
|
||||
<button class="frost-button frost-button--icon frost-tooltip" data-frost-tooltip="Copy link" aria-label="Copy link">⧉</button>
|
||||
<button class="frost-button frost-button--icon frost-tooltip" data-frost-tooltip="Link kopieren" aria-label="Link kopieren">⧉</button>
|
||||
```
|
||||
|
||||
Modal, drawer, dropdown, and popover behavior is deliberately separate from CSS. A behavior layer should toggle `hidden`, synchronize `aria-expanded`, move focus into dialogs, return focus to the trigger, and close on Escape where appropriate. For modal dialogs, use `role="dialog" aria-modal="true"` and a labelled heading.
|
||||
Das Verhalten von Modal, Drawer, Dropdown und Popover ist bewusst vom CSS getrennt. Eine Behavior-Schicht sollte `hidden` umschalten, `aria-expanded` synchron halten, den Fokus in Dialoge setzen, nach dem Schließen zum Trigger zurückbringen und – wo sinnvoll – mit Escape schließen. Für Modals `role="dialog" aria-modal="true"` und eine beschriftende Überschrift verwenden.
|
||||
|
||||
## Responsive utilities
|
||||
Weitere CSS-only Bausteine sind `frost-navbar`, `frost-breadcrumbs`, `frost-tabs`, `frost-accordion`, `frost-pagination`, `frost-table` und `frost-spinner`. Sie liefern Markup-Struktur und Zustände; Interaktionen wie Tabs umschalten oder Accordion öffnen bleiben bei der Anwendung.
|
||||
|
||||
`frost-cluster` is a wrapping flex row for actions, while `frost-hide-mobile`, `frost-show-mobile`, `frost-hide-desktop`, and `frost-responsive` cover common responsive composition needs. Layout components expose local properties such as `--frost-grid-min` and `--frost-cluster-gap` so applications can tune them without new framework classes.
|
||||
## Responsive Helfer
|
||||
|
||||
## Customization
|
||||
`frost-cluster` ist eine umbrechende Flex-Reihe für Aktionen. `frost-hide-mobile`, `frost-show-mobile`, `frost-hide-desktop` und `frost-responsive` decken ein paar typische Responsive-Fälle ab. Layout-Komponenten haben lokale Properties wie `--frost-grid-min` und `--frost-cluster-gap`, sodass sie ohne neue Framework-Klassen angepasst werden können.
|
||||
|
||||
Override semantic tokens in the project layer:
|
||||
## Anpassen
|
||||
|
||||
Semantische Tokens können auf Projektebene überschrieben werden:
|
||||
|
||||
```css
|
||||
:root {
|
||||
@@ -176,11 +244,11 @@ Override semantic tokens in the project layer:
|
||||
}
|
||||
```
|
||||
|
||||
The public API uses the `frost-` class prefix and `--frost-*` custom-property prefix to reduce collisions with project CSS and third-party libraries.
|
||||
Die öffentliche API verwendet den Präfix `frost-` für Klassen und `--frost-*` für Custom Properties. So gibt es weniger Konflikte mit dem eigenen CSS und Libraries von Drittanbietern.
|
||||
|
||||
## Package maintenance
|
||||
## Paket pflegen
|
||||
|
||||
The package intentionally ships only the CSS modules, documentation, license, and small dependency-free validation scripts. Example pages remain in the repository but are excluded from the npm tarball.
|
||||
Das Paket enthält absichtlich nur die CSS-Module, die Doku, die Lizenz und ein paar kleine, dependency-freie Validierungsskripte. Beispielseiten bleiben im Repository, landen aber nicht im npm-Tarball.
|
||||
|
||||
```bash
|
||||
npm run lint
|
||||
@@ -188,7 +256,14 @@ npm run size
|
||||
npm pack --dry-run
|
||||
```
|
||||
|
||||
## Philosophy
|
||||
Neben dem vollständigen Paket können einzelne Schichten importiert werden:
|
||||
|
||||
Frost is intentionally smaller than Bootstrap and Tailwind. It establishes predictable foundations while leaving branding, page composition, JavaScript behavior, and specialized components to the project using it.
|
||||
```css
|
||||
@import "@fretuks/frost/utilities";
|
||||
@import "@fretuks/frost/components";
|
||||
@import "@fretuks/frost/tokens";
|
||||
```
|
||||
|
||||
## Warum das Ganze?
|
||||
|
||||
Frost soll eine überschaubare, verlässliche Grundlage sein. Branding, konkrete Seitengestaltung, JavaScript-Verhalten und speziellere Komponenten bleiben dort, wo sie hingehören: im jeweiligen Projekt.
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
:where(button:disabled, input:disabled, select:disabled, textarea:disabled) { cursor: not-allowed; }
|
||||
:where(img, picture, video, canvas, svg) { display: block; max-width: 100%; }
|
||||
:where(img, video) { height: auto; }
|
||||
:where(a) { color: var(--frost-color-accent); }
|
||||
:where(a) { color: var(--frost-color-link); }
|
||||
:where(a:hover) { color: var(--frost-color-link-hover); }
|
||||
:where(button) { color: inherit; }
|
||||
:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) { margin-block: 0; }
|
||||
:where(h1, h2, h3, h4, h5, h6) {
|
||||
@@ -36,6 +37,8 @@
|
||||
:where(h1) { font-size: clamp(2rem, 5vw, 3.5rem); }
|
||||
:where(h2) { font-size: var(--frost-font-size-xl); }
|
||||
:where(code, kbd, pre) { font-family: var(--frost-font-mono); }
|
||||
:where(code, kbd) { padding: 0.1em 0.3em; border-radius: var(--frost-radius-sm); background: var(--frost-color-code-bg); color: var(--frost-color-code-text); }
|
||||
:where(pre) { overflow: auto; padding: var(--frost-space-4); border: 1px solid var(--frost-color-border); border-radius: var(--frost-radius-md); background: var(--frost-color-code-bg); color: var(--frost-color-code-text); }
|
||||
:where(table) { border-collapse: collapse; border-spacing: 0; }
|
||||
:where(th, td) { text-align: start; }
|
||||
:where(::selection) { background: var(--frost-color-selection); color: var(--frost-color-on-accent); }
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
@layer frost.tokens, frost.base, frost.accessibility, frost.layout, frost.controls, frost.components;
|
||||
|
||||
@import url("./core.css");
|
||||
@import url("./layout.css") layer(frost.layout);
|
||||
@import url("./controls.css") layer(frost.controls);
|
||||
@import url("./components.css") layer(frost.components);
|
||||
+37
-8
@@ -103,18 +103,47 @@
|
||||
.frost-modal--drawer { place-items: stretch end; padding: 0; }
|
||||
.frost-modal--drawer .frost-modal__content { width: min(100%, 28rem); max-height: none; height: 100%; border-radius: var(--frost-radius-lg) 0 0 var(--frost-radius-lg); }
|
||||
|
||||
.frost-navbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--frost-space-4); padding-block: var(--frost-space-4); }
|
||||
.frost-navbar__brand { color: var(--frost-color-text); font-weight: 700; text-decoration: none; }
|
||||
.frost-navbar__links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--frost-space-2); }
|
||||
.frost-navbar__link { padding: var(--frost-space-2) var(--frost-space-3); border-radius: var(--frost-radius-sm); color: var(--frost-color-text-muted); text-decoration: none; }
|
||||
.frost-navbar__link:hover, .frost-navbar__link[aria-current="page"] { background: var(--frost-color-surface-soft); color: var(--frost-color-text); }
|
||||
|
||||
.frost-breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--frost-space-2); color: var(--frost-color-text-muted); font-size: var(--frost-font-size-sm); }
|
||||
.frost-breadcrumbs__item:not(:last-child)::after { margin-inline-start: var(--frost-space-2); color: var(--frost-color-border-strong); content: "/"; }
|
||||
.frost-breadcrumbs__item[aria-current="page"] { color: var(--frost-color-text); }
|
||||
|
||||
.frost-tabs { display: flex; flex-wrap: wrap; gap: var(--frost-space-1); border-block-end: 1px solid var(--frost-color-border); }
|
||||
.frost-tabs__tab { padding: var(--frost-space-2) var(--frost-space-3); border: 0; border-block-end: 2px solid transparent; background: transparent; color: var(--frost-color-text-muted); cursor: pointer; }
|
||||
.frost-tabs__tab:hover, .frost-tabs__tab[aria-selected="true"] { border-block-end-color: var(--frost-color-accent); color: var(--frost-color-text); }
|
||||
.frost-tabs__panel { padding-block: var(--frost-space-4); }
|
||||
|
||||
.frost-accordion { border-block-start: 1px solid var(--frost-color-border); }
|
||||
.frost-accordion__item { border-block-end: 1px solid var(--frost-color-border); }
|
||||
.frost-accordion__trigger { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: var(--frost-space-4); padding: var(--frost-space-4) 0; border: 0; background: transparent; color: var(--frost-color-text); text-align: start; font-weight: 650; }
|
||||
.frost-accordion__panel { padding-block: 0 var(--frost-space-4); }
|
||||
.frost-accordion__panel[hidden] { display: none; }
|
||||
|
||||
.frost-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--frost-space-1); }
|
||||
.frost-pagination__item { display: inline-flex; min-width: 2.5rem; min-height: 2.5rem; align-items: center; justify-content: center; padding: var(--frost-space-2); border: 1px solid var(--frost-color-border); border-radius: var(--frost-radius-sm); background: var(--frost-color-surface); color: var(--frost-color-text); text-decoration: none; }
|
||||
.frost-pagination__item:hover, .frost-pagination__item[aria-current="page"] { border-color: var(--frost-color-accent); background: var(--frost-color-accent); color: var(--frost-color-on-accent); }
|
||||
|
||||
.frost-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
|
||||
.frost-table { width: 100%; min-width: 32rem; border: 1px solid var(--frost-color-border); }
|
||||
.frost-table th, .frost-table td { padding: var(--frost-space-3) var(--frost-space-4); border-block-end: 1px solid var(--frost-color-border); }
|
||||
.frost-table th { background: var(--frost-color-surface-soft); font-weight: 700; }
|
||||
.frost-table tbody tr:hover { background: var(--frost-color-surface-soft); }
|
||||
|
||||
.frost-spinner { display: inline-block; width: 1.25rem; height: 1.25rem; border: 0.18rem solid var(--frost-color-border); border-block-start-color: var(--frost-color-accent); border-radius: 50%; animation: frost-spin 700ms linear infinite; }
|
||||
.frost-spinner--sm { width: 1rem; height: 1rem; }
|
||||
.frost-spinner--lg { width: 2rem; height: 2rem; }
|
||||
@keyframes frost-spin { to { transform: rotate(360deg); } }
|
||||
|
||||
[data-theme="dark"] .frost-tooltip::after { background: var(--frost-color-surface-soft); color: var(--frost-color-text); }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.frost-card--interactive:hover,
|
||||
.frost-card--interactive:focus-within { transform: none; }
|
||||
.frost-spinner { animation-duration: 0.01ms; animation-iteration-count: 1; }
|
||||
}
|
||||
}
|
||||
|
||||
@layer frost.utilities {
|
||||
.frost-text-muted { color: var(--frost-color-text-muted); }
|
||||
.frost-text-center { text-align: center; }
|
||||
.frost-width-full { width: 100%; }
|
||||
.frost-overflow-auto { overflow: auto; }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
@layer frost.tokens, frost.base, frost.accessibility;
|
||||
|
||||
@import url("./tokens.css") layer(frost.tokens);
|
||||
@import url("./base.css") layer(frost.base);
|
||||
@import url("./accessibility.css") layer(frost.accessibility);
|
||||
+84
-34
@@ -1,9 +1,9 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Frost v0.4 example</title>
|
||||
<title>Frost – Beispiel</title>
|
||||
<link rel="stylesheet" href="../frost.css">
|
||||
<style>
|
||||
body { padding-block: var(--frost-space-8); }
|
||||
@@ -17,76 +17,113 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a class="frost-skip-link" href="#main">Skip to content</a>
|
||||
<a class="frost-skip-link" href="#main">Zum Inhalt springen</a>
|
||||
<main id="main" class="frost-container">
|
||||
<header class="example-header">
|
||||
<div>
|
||||
<p class="frost-text-muted">Frost CSS framework</p>
|
||||
<h1>Small foundations for cold starts.</h1>
|
||||
<p class="frost-text-muted">Frost CSS Framework</p>
|
||||
<h1>Kleine Bausteine für eigene Projekte.</h1>
|
||||
</div>
|
||||
<button class="frost-button frost-button--secondary" id="theme-toggle" type="button">Toggle theme</button>
|
||||
<button class="frost-button frost-button--secondary" id="theme-toggle" type="button">Theme wechseln</button>
|
||||
</header>
|
||||
|
||||
<section class="frost-notice frost-notice--info" aria-label="Framework note">
|
||||
Frost is CSS-only. This page uses a tiny script only to demonstrate explicit theme switching.
|
||||
<section class="frost-notice frost-notice--info" aria-label="Hinweis zum Framework">
|
||||
Frost ist CSS-only. Das kleine Script auf dieser Seite zeigt nur den Theme-Wechsel und das Öffnen des Menüs.
|
||||
</section>
|
||||
|
||||
<section class="example-section frost-stack">
|
||||
<h2>Tokens and surfaces</h2>
|
||||
<div class="frost-grid" style="--frost-grid-min: 12rem">
|
||||
<div class="swatch">Accent</div>
|
||||
<div class="frost-card frost-card--flat">Flat card</div>
|
||||
<div class="frost-card frost-card--elevated">Elevated card</div>
|
||||
<h2>Tokens und Oberflächen</h2>
|
||||
<div class="frost-grid frost-gap-4 frost-md:grid-cols-2" style="--frost-grid-min: 12rem">
|
||||
<div class="swatch frost-rounded frost-shadow-sm">Akzent</div>
|
||||
<div class="frost-card frost-card--flat frost-p-6">Flache Karte</div>
|
||||
<div class="frost-card frost-card--elevated frost-p-6 frost-hover:shadow">Erhöhte Karte</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="example-section frost-stack">
|
||||
<h2>Feedback and menus</h2>
|
||||
<h2>Feedback und Menüs</h2>
|
||||
<div class="frost-alert frost-alert--warning" role="alert">
|
||||
<strong class="frost-alert__title">Heads up</strong>
|
||||
<span class="frost-alert__body">This is a dismissible-style alert primitive; your behavior layer controls dismissal.</span>
|
||||
<strong class="frost-alert__title">Hinweis</strong>
|
||||
<span class="frost-alert__body">Das CSS stellt nur die Darstellung bereit; das Verhalten kommt aus deiner Anwendung.</span>
|
||||
</div>
|
||||
<div class="frost-cluster">
|
||||
<div class="frost-dropdown">
|
||||
<button class="frost-button frost-button--secondary" id="menu-trigger" type="button" aria-expanded="false" aria-controls="example-menu">Open menu</button>
|
||||
<button class="frost-button frost-button--secondary" id="menu-trigger" type="button" aria-expanded="false" aria-controls="example-menu">Menü öffnen</button>
|
||||
<div class="frost-dropdown__menu" id="example-menu" hidden>
|
||||
<a class="frost-dropdown__item" href="#main">Overview</a>
|
||||
<button class="frost-dropdown__item" type="button">A menu action</button>
|
||||
<a class="frost-dropdown__item" href="#main">Übersicht</a>
|
||||
<button class="frost-dropdown__item" type="button">Eine Aktion</button>
|
||||
</div>
|
||||
</div>
|
||||
<button class="frost-button frost-button--primary frost-tooltip" data-frost-tooltip="A CSS-only tooltip" aria-label="Tooltip demo">Hover or focus</button>
|
||||
<button class="frost-button frost-button--primary frost-tooltip" data-frost-tooltip="Ein CSS-only Tooltip" aria-label="Tooltip-Demo">Hover oder Fokus</button>
|
||||
</div>
|
||||
<div class="frost-toast frost-toast--success" role="status"><span>Changes saved successfully.</span><button class="frost-button frost-button--icon" type="button" aria-label="Dismiss example toast">×</button></div>
|
||||
<div class="frost-toast frost-toast--success" role="status"><span>Änderungen gespeichert.</span><button class="frost-button frost-button--icon" type="button" aria-label="Hinweis schließen">×</button></div>
|
||||
</section>
|
||||
|
||||
<section class="example-section frost-stack">
|
||||
<h2>Buttons and badges</h2>
|
||||
<h2>Buttons und Badges</h2>
|
||||
<div class="frost-row">
|
||||
<button class="frost-button frost-button--primary">Primary</button>
|
||||
<button class="frost-button frost-button--secondary">Secondary</button>
|
||||
<button class="frost-button frost-button--primary">Primär</button>
|
||||
<button class="frost-button frost-button--secondary">Sekundär</button>
|
||||
<button class="frost-button frost-button--ghost">Ghost</button>
|
||||
<button class="frost-button frost-button--danger">Danger</button>
|
||||
<button class="frost-button frost-button--secondary" disabled>Disabled</button>
|
||||
<span class="frost-badge frost-badge--success">Success</span>
|
||||
<span class="frost-badge frost-badge--warning">Warning</span>
|
||||
<button class="frost-button frost-button--danger">Gefahr</button>
|
||||
<button class="frost-button frost-button--secondary" disabled>Deaktiviert</button>
|
||||
<span class="frost-badge frost-badge--success">Erfolg</span>
|
||||
<span class="frost-badge frost-badge--warning">Warnung</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="example-section frost-grid" style="--frost-grid-min: 18rem">
|
||||
<div class="frost-card">
|
||||
<h2>Form controls</h2>
|
||||
<h2>Formularfelder</h2>
|
||||
<form class="frost-stack" style="--frost-stack-gap: var(--frost-space-4)">
|
||||
<label class="frost-field"><span class="frost-label">Name</span><input class="frost-input" type="text" placeholder="Ada Lovelace"></label>
|
||||
<label class="frost-field"><span class="frost-label">Type</span><select class="frost-select"><option>Website</option><option>Application</option></select></label>
|
||||
<label class="frost-field"><span class="frost-label">Message</span><textarea class="frost-textarea" placeholder="Write something..."></textarea></label>
|
||||
<button class="frost-button frost-button--primary" type="submit">Submit</button>
|
||||
<label class="frost-field"><span class="frost-label">Typ</span><select class="frost-select"><option>Website</option><option>Anwendung</option></select></label>
|
||||
<label class="frost-field"><span class="frost-label">Nachricht</span><textarea class="frost-textarea" placeholder="Schreib etwas..."></textarea></label>
|
||||
<button class="frost-button frost-button--primary" type="submit">Absenden</button>
|
||||
</form>
|
||||
</div>
|
||||
<div id="controls" class="frost-sidebar-layout">
|
||||
<aside class="frost-sidebar example-sidebar"><strong>Sidebar</strong><a href="#main">Overview</a><a href="#controls">Controls</a></aside>
|
||||
<div class="frost-main frost-card frost-card--flat"><h2>Sidebar layout</h2><p class="frost-text-muted">The layout becomes a normal single column below 48rem.</p></div>
|
||||
<aside class="frost-sidebar example-sidebar"><strong>Sidebar</strong><a href="#main">Übersicht</a><a href="#controls">Controls</a></aside>
|
||||
<div class="frost-main frost-card frost-card--flat"><h2>Sidebar-Layout</h2><p class="frost-text-muted">Unter 48rem wird daraus eine normale einspaltige Ansicht.</p></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="example-section frost-stack">
|
||||
<h2>Utilities</h2>
|
||||
<div class="frost-card frost-stack frost-p-6">
|
||||
<div class="frost-flex frost-flex-wrap frost-items-center frost-justify-between frost-gap-4">
|
||||
<div>
|
||||
<strong class="frost-text-lg">Utility-first, wenn es schnell gehen soll</strong>
|
||||
<p class="frost-mt-2 frost-text-muted">Die Klassen lassen sich direkt kombinieren.</p>
|
||||
</div>
|
||||
<span class="frost-badge frost-badge--info">md:grid-cols-2</span>
|
||||
</div>
|
||||
<div class="frost-grid frost-grid-cols-1 frost-md:grid-cols-2 frost-gap-4">
|
||||
<div class="frost-bg-soft frost-border frost-rounded frost-p-4 frost-hover:shadow">Spacing: <code>frost-p-4</code></div>
|
||||
<div class="frost-bg-accent frost-rounded frost-p-4">Farben: <code>frost-bg-accent</code></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="example-section frost-stack">
|
||||
<h2>Weitere Komponenten</h2>
|
||||
<nav class="frost-navbar frost-border frost-rounded frost-p-4" aria-label="Beispielnavigation">
|
||||
<a class="frost-navbar__brand" href="#main">Frost</a>
|
||||
<div class="frost-navbar__links"><a class="frost-navbar__link" href="#main" aria-current="page">Start</a><a class="frost-navbar__link" href="#controls">Controls</a></div>
|
||||
</nav>
|
||||
<nav class="frost-breadcrumbs" aria-label="Breadcrumb"><a class="frost-breadcrumbs__item" href="#main">Start</a><a class="frost-breadcrumbs__item" href="#controls">Dokumentation</a><span class="frost-breadcrumbs__item" aria-current="page">Komponenten</span></nav>
|
||||
<div class="frost-tabs" role="tablist" aria-label="Beispieltabs">
|
||||
<button class="frost-tabs__tab" role="tab" aria-selected="true" aria-controls="tab-panel-one" id="tab-one">Übersicht</button>
|
||||
<button class="frost-tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-two" id="tab-two">Details</button>
|
||||
</div>
|
||||
<div class="frost-tabs__panel" role="tabpanel" id="tab-panel-one" aria-labelledby="tab-one">Ein einfaches Tab-Panel.</div>
|
||||
<div class="frost-tabs__panel" role="tabpanel" id="tab-panel-two" aria-labelledby="tab-two" hidden>Ein zweites Panel für Details.</div>
|
||||
<div class="frost-accordion">
|
||||
<div class="frost-accordion__item"><button class="frost-accordion__trigger" aria-expanded="false" aria-controls="accordion-panel">Was macht Frost?</button><div class="frost-accordion__panel" id="accordion-panel" hidden>Frost verbindet kleine Utilities mit fertigen CSS-Komponenten.</div></div>
|
||||
</div>
|
||||
<div class="frost-table-wrap"><table class="frost-table"><thead><tr><th>Klasse</th><th>Wofür?</th></tr></thead><tbody><tr><td><code>frost-card</code></td><td>Oberfläche mit Border und Radius</td></tr><tr><td><code>frost-grid</code></td><td>Responsive Grid-Grundlage</td></tr></tbody></table></div>
|
||||
<div class="frost-flex frost-items-center frost-gap-3"><span class="frost-spinner" aria-label="Lädt"></span><span class="frost-text-muted">Beispiel für einen Spinner</span></div>
|
||||
</section>
|
||||
</main>
|
||||
<script>
|
||||
document.querySelector('#theme-toggle').addEventListener('click', () => {
|
||||
@@ -99,6 +136,19 @@
|
||||
trigger.setAttribute('aria-expanded', String(!open));
|
||||
menu.hidden = open;
|
||||
});
|
||||
document.querySelectorAll('[role="tab"]').forEach((tab) => {
|
||||
tab.addEventListener('click', () => {
|
||||
document.querySelectorAll('[role="tab"]').forEach((item) => item.setAttribute('aria-selected', String(item === tab)));
|
||||
document.querySelectorAll('[role="tabpanel"]').forEach((panel) => { panel.hidden = panel.id !== tab.getAttribute('aria-controls'); });
|
||||
});
|
||||
});
|
||||
document.querySelector('.frost-accordion__trigger').addEventListener('click', (event) => {
|
||||
const trigger = event.currentTarget;
|
||||
const panel = document.getElementById(trigger.getAttribute('aria-controls'));
|
||||
const open = trigger.getAttribute('aria-expanded') === 'true';
|
||||
trigger.setAttribute('aria-expanded', String(!open));
|
||||
panel.hidden = open;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
@layer frost.tokens, frost.base, frost.accessibility, frost.layout, frost.controls, frost.components, frost.utilities;
|
||||
|
||||
@import url("./tokens.css") layer(frost.tokens);
|
||||
@import url("./base.css") layer(frost.base);
|
||||
@import url("./accessibility.css") layer(frost.accessibility);
|
||||
@import url("./core.css");
|
||||
@import url("./layout.css") layer(frost.layout);
|
||||
@import url("./controls.css") layer(frost.controls);
|
||||
@import url("./components.css") layer(frost.components);
|
||||
@import url("./utilities.css") layer(frost.utilities);
|
||||
|
||||
|
||||
+17
-2
@@ -1,21 +1,33 @@
|
||||
{
|
||||
"name": "@fretuks/frost",
|
||||
"version": "0.4.0",
|
||||
"version": "0.5.0",
|
||||
"description": "A compact, semantic CSS foundation for websites and web applications.",
|
||||
"style": "./frost.css",
|
||||
"exports": {
|
||||
".": "./frost.css",
|
||||
"./frost.css": "./frost.css",
|
||||
"./core.css": "./core.css",
|
||||
"./utility-layer.css": "./utility-layer.css",
|
||||
"./component-layer.css": "./component-layer.css",
|
||||
"./tokens.css": "./tokens.css",
|
||||
"./base.css": "./base.css",
|
||||
"./accessibility.css": "./accessibility.css",
|
||||
"./layout.css": "./layout.css",
|
||||
"./controls.css": "./controls.css",
|
||||
"./components.css": "./components.css",
|
||||
"./utilities.css": "./utilities.css",
|
||||
"./base": "./base.css",
|
||||
"./core": "./core.css",
|
||||
"./utility-layer": "./utility-layer.css",
|
||||
"./component-layer": "./component-layer.css",
|
||||
"./components": "./components.css",
|
||||
"./utilities": "./utilities.css",
|
||||
"./tokens": "./tokens.css",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"*.css",
|
||||
"dist/*.css",
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE",
|
||||
@@ -38,7 +50,10 @@
|
||||
"scripts": {
|
||||
"lint": "node scripts/check.mjs",
|
||||
"size": "node scripts/size.mjs",
|
||||
"test": "node scripts/check.mjs"
|
||||
"build": "node scripts/build.mjs",
|
||||
"test": "node scripts/check.mjs && node scripts/check-example.mjs",
|
||||
"test:example": "node scripts/check-example.mjs",
|
||||
"generate:utilities": "node scripts/generate-utilities.mjs"
|
||||
},
|
||||
"sideEffects": true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
||||
import { resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = fileURLToPath(new URL("..", import.meta.url));
|
||||
const output = resolve(root, "dist");
|
||||
const layers = {
|
||||
"frost.css": ["tokens.css", "base.css", "accessibility.css", "layout.css", "controls.css", "components.css", "utilities.css"],
|
||||
"utility-layer.css": ["tokens.css", "base.css", "accessibility.css", "layout.css", "utilities.css"],
|
||||
"component-layer.css": ["tokens.css", "base.css", "accessibility.css", "layout.css", "controls.css", "components.css"],
|
||||
};
|
||||
|
||||
const minify = (source) => source
|
||||
.replace(/\/\*[^!*][\s\S]*?\*\//g, "")
|
||||
.replace(/\s+/g, " ")
|
||||
.replace(/\s*([{}:;,>])\s*/g, "$1")
|
||||
.trim();
|
||||
|
||||
await mkdir(output, { recursive: true });
|
||||
for (const [name, files] of Object.entries(layers)) {
|
||||
const source = (await Promise.all(files.map((file) => readFile(resolve(root, file), "utf8")))).join("\n");
|
||||
await writeFile(resolve(output, name), `${source}\n`);
|
||||
await writeFile(resolve(output, name.replace(".css", ".min.css")), `${minify(source)}\n`);
|
||||
}
|
||||
console.log(`Built ${Object.keys(layers).length} CSS entry points in dist/.`);
|
||||
@@ -0,0 +1,26 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = fileURLToPath(new URL("..", import.meta.url));
|
||||
const html = await readFile(resolve(root, "examples/index.html"), "utf8");
|
||||
const required = [
|
||||
"frost-md:grid-cols-2",
|
||||
"frost-hover:shadow",
|
||||
"frost-navbar",
|
||||
"frost-breadcrumbs",
|
||||
"frost-tabs",
|
||||
"frost-accordion",
|
||||
"frost-table",
|
||||
"frost-spinner",
|
||||
"#theme-toggle",
|
||||
"#menu-trigger",
|
||||
];
|
||||
const errors = required.filter((value) => !html.includes(value)).map((value) => `examples/index.html: missing demo marker ${value}`);
|
||||
if (!html.includes("aria-selected") || !html.includes("aria-expanded")) errors.push("examples/index.html: interactive ARIA state markers are missing");
|
||||
if (errors.length) {
|
||||
console.error(errors.join("\n"));
|
||||
process.exitCode = 1;
|
||||
} else {
|
||||
console.log(`Checked ${required.length} utility, component, and interaction markers in examples/index.html.`);
|
||||
}
|
||||
@@ -5,12 +5,16 @@ import { fileURLToPath } from "node:url";
|
||||
const root = fileURLToPath(new URL("..", import.meta.url));
|
||||
const cssFiles = [
|
||||
"frost.css",
|
||||
"core.css",
|
||||
"utility-layer.css",
|
||||
"component-layer.css",
|
||||
"tokens.css",
|
||||
"base.css",
|
||||
"accessibility.css",
|
||||
"layout.css",
|
||||
"controls.css",
|
||||
"components.css",
|
||||
"utilities.css",
|
||||
];
|
||||
|
||||
const errors = [];
|
||||
@@ -30,6 +34,40 @@ for (const match of entry.matchAll(/@import\s+url\("([^"]+)"\)/g)) {
|
||||
catch { errors.push(`frost.css: missing import ${match[1]}`); }
|
||||
}
|
||||
|
||||
const layerSources = {
|
||||
"core.css": ["tokens.css", "base.css", "accessibility.css"],
|
||||
"utility-layer.css": ["core.css", "layout.css", "utilities.css"],
|
||||
"component-layer.css": ["core.css", "layout.css", "controls.css", "components.css"],
|
||||
};
|
||||
for (const [file, requiredImports] of Object.entries(layerSources)) {
|
||||
const source = await readFile(resolve(root, file), "utf8");
|
||||
for (const requiredImport of requiredImports) {
|
||||
if (!source.includes(`./${requiredImport}`)) errors.push(`${file}: missing layer import ${requiredImport}`);
|
||||
}
|
||||
}
|
||||
const utilityLayerSource = await readFile(resolve(root, "utility-layer.css"), "utf8");
|
||||
const componentLayerSource = await readFile(resolve(root, "component-layer.css"), "utf8");
|
||||
if (utilityLayerSource.includes("./controls.css") || utilityLayerSource.includes("./components.css")) errors.push("utility-layer.css: component layer leaked into utility entry point");
|
||||
if (componentLayerSource.includes("./utilities.css")) errors.push("component-layer.css: utility layer leaked into component entry point");
|
||||
|
||||
const utilitySource = await readFile(resolve(root, "utilities.css"), "utf8");
|
||||
for (const utility of ["frost-flex", "frost-grid", "frost-gap-4", "frost-p-4", "frost-md\\:grid-cols-2", "frost-hover\\:bg-soft"]) {
|
||||
if (!utilitySource.includes(`.${utility}`)) errors.push(`utilities.css: missing public utility ${utility}`);
|
||||
}
|
||||
|
||||
const componentsSource = await readFile(resolve(root, "components.css"), "utf8");
|
||||
for (const component of ["frost-navbar", "frost-breadcrumbs", "frost-tabs", "frost-accordion", "frost-pagination", "frost-table", "frost-spinner"]) {
|
||||
if (!componentsSource.includes(`.${component}`)) errors.push(`components.css: missing public component ${component}`);
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(await readFile(resolve(root, "package.json"), "utf8"));
|
||||
for (const exportPath of ["./utilities", "./components", "./tokens"]) {
|
||||
if (!packageJson.exports[exportPath]) errors.push(`package.json: missing export ${exportPath}`);
|
||||
}
|
||||
for (const exportPath of ["./core", "./utility-layer", "./component-layer"]) {
|
||||
if (!packageJson.exports[exportPath]) errors.push(`package.json: missing layer export ${exportPath}`);
|
||||
}
|
||||
|
||||
if (errors.length) {
|
||||
console.error(errors.join("\n"));
|
||||
process.exitCode = 1;
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import { writeFile } from "node:fs/promises";
|
||||
import { resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = fileURLToPath(new URL("..", import.meta.url));
|
||||
const spaces = ["0", "1", "2", "3", "4", "5", "6", "8", "10", "12", "16"];
|
||||
const breakpoints = { md: "48rem", lg: "64rem" };
|
||||
const lines = ["@layer frost.utilities {", " /* Generated by scripts/generate-utilities.mjs. Edit the generator, not this file. */"];
|
||||
const add = (name, declaration) => lines.push(` .frost-${name} { ${declaration}; }`);
|
||||
const addVariant = (variant, name, declaration, pseudo = "") => lines.push(` .frost-${variant}\\:${name}${pseudo} { ${declaration}; }`);
|
||||
|
||||
const declarations = [
|
||||
["block", "display: block"], ["inline-block", "display: inline-block"], ["inline", "display: inline"], ["flex", "display: flex"], ["inline-flex", "display: inline-flex"], ["grid", "display: grid"], ["hidden", "display: none !important"], ["visible", "visibility: visible"], ["invisible", "visibility: hidden"],
|
||||
["relative", "position: relative"], ["absolute", "position: absolute"], ["fixed", "position: fixed"], ["sticky", "position: sticky"], ["flex-wrap", "flex-wrap: wrap"], ["flex-nowrap", "flex-wrap: nowrap"], ["flex-row", "flex-direction: row"], ["flex-col", "flex-direction: column"], ["flex-1", "flex: 1 1 0%"], ["flex-auto", "flex: 1 1 auto"], ["flex-none", "flex: none"], ["grow", "flex-grow: 1"], ["grow-0", "flex-grow: 0"], ["shrink", "flex-shrink: 1"], ["shrink-0", "flex-shrink: 0"], ["min-w-0", "min-width: 0"], ["w-full", "width: 100%"], ["h-full", "height: 100%"], ["w-screen", "width: 100vw"], ["h-screen", "height: 100vh"], ["min-h-screen", "min-height: 100vh"],
|
||||
["items-start", "align-items: flex-start"], ["items-center", "align-items: center"], ["items-end", "align-items: flex-end"], ["items-stretch", "align-items: stretch"], ["justify-start", "justify-content: flex-start"], ["justify-center", "justify-content: center"], ["justify-end", "justify-content: flex-end"], ["justify-between", "justify-content: space-between"], ["justify-around", "justify-content: space-around"], ["justify-evenly", "justify-content: space-evenly"], ["content-center", "align-content: center"], ["self-start", "align-self: flex-start"], ["self-center", "align-self: center"], ["self-end", "align-self: flex-end"], ["place-items-center", "place-items: center"], ["text-left", "text-align: left"], ["text-center", "text-align: center"], ["text-right", "text-align: right"], ["text-start", "text-align: start"], ["text-end", "text-align: end"], ["truncate", "overflow: hidden; text-overflow: ellipsis; white-space: nowrap"], ["overflow-hidden", "overflow: hidden"], ["overflow-auto", "overflow: auto"], ["overflow-x-auto", "overflow-x: auto"],
|
||||
["border", "border: 1px solid var(--frost-color-border)"], ["border-strong", "border: 1px solid var(--frost-color-border-strong)"], ["border-0", "border: 0"], ["rounded-sm", "border-radius: var(--frost-radius-sm)"], ["rounded", "border-radius: var(--frost-radius-md)"], ["rounded-lg", "border-radius: var(--frost-radius-lg)"], ["rounded-xl", "border-radius: var(--frost-radius-xl)"], ["rounded-pill", "border-radius: var(--frost-radius-pill)"], ["rounded-full", "border-radius: 9999px"], ["shadow-sm", "box-shadow: var(--frost-shadow-sm)"], ["shadow", "box-shadow: var(--frost-shadow-md)"], ["shadow-lg", "box-shadow: var(--frost-shadow-lg)"], ["shadow-none", "box-shadow: none"],
|
||||
["font-normal", "font-weight: 400"], ["font-medium", "font-weight: 500"], ["font-semibold", "font-weight: 650"], ["font-bold", "font-weight: 700"], ["font-mono", "font-family: var(--frost-font-mono)"], ["leading-body", "line-height: var(--frost-line-height-body)"], ["leading-heading", "line-height: var(--frost-line-height-heading)"], ["leading-none", "line-height: 1"], ["uppercase", "text-transform: uppercase"], ["lowercase", "text-transform: lowercase"], ["italic", "font-style: italic"],
|
||||
["text", "color: var(--frost-color-text)"], ["text-muted", "color: var(--frost-color-text-muted)"], ["text-accent", "color: var(--frost-color-accent)"], ["text-success", "color: var(--frost-color-success)"], ["text-warning", "color: var(--frost-color-warning)"], ["text-danger", "color: var(--frost-color-danger)"], ["text-link", "color: var(--frost-color-link)"], ["bg", "background-color: var(--frost-color-bg)"], ["bg-surface", "background-color: var(--frost-color-surface)"], ["bg-soft", "background-color: var(--frost-color-surface-soft)"], ["bg-accent", "background-color: var(--frost-color-accent); color: var(--frost-color-on-accent)"], ["bg-success", "background-color: var(--frost-color-success); color: var(--frost-color-on-success)"], ["bg-warning", "background-color: var(--frost-color-warning); color: var(--frost-color-on-warning)"], ["bg-danger", "background-color: var(--frost-color-danger); color: var(--frost-color-on-danger)"],
|
||||
["max-w-sm", "max-width: 24rem"], ["max-w-md", "max-width: 32rem"], ["max-w-lg", "max-width: 48rem"], ["max-w-xl", "max-width: 64rem"], ["max-w-none", "max-width: none"], ["opacity-0", "opacity: 0"], ["opacity-50", "opacity: 0.5"], ["opacity-75", "opacity: 0.75"], ["opacity-100", "opacity: 1"], ["pointer-events-none", "pointer-events: none"],
|
||||
];
|
||||
for (const [name, declaration] of declarations) add(name, declaration);
|
||||
|
||||
for (const space of spaces) {
|
||||
const token = `var(--frost-space-${space})`;
|
||||
for (const [prefix, property] of [["gap", "gap"], ["p", "padding"], ["px", "padding-inline"], ["py", "padding-block"], ["pt", "padding-block-start"], ["pr", "padding-inline-end"], ["pb", "padding-block-end"], ["pl", "padding-inline-start"], ["m", "margin"], ["mx", "margin-inline"], ["my", "margin-block"], ["mt", "margin-block-start"], ["mr", "margin-inline-end"], ["mb", "margin-block-end"], ["ml", "margin-inline-start"]]) add(`${prefix}-${space}`, `${property}: ${token}`);
|
||||
}
|
||||
add("mx-auto", "margin-inline: auto"); add("my-auto", "margin-block: auto");
|
||||
add("space-y-0", "--frost-space-y: 0");
|
||||
for (const space of spaces.filter((value) => value !== "0")) add(`space-y-${space}`, `--frost-space-y: var(--frost-space-${space})`);
|
||||
lines.push(" .frost-space-y-0 > :not([hidden]) ~ :not([hidden]) { margin-block-start: 0; }");
|
||||
for (const space of spaces.filter((value) => value !== "0")) lines.push(` .frost-space-y-${space} > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-${space}); }`);
|
||||
add("grid-cols-1", "grid-template-columns: repeat(1, minmax(0, 1fr))");
|
||||
for (const count of [2, 3, 4, 5, 6, 12]) add(`grid-cols-${count}`, `grid-template-columns: repeat(${count}, minmax(0, 1fr))`);
|
||||
for (const count of [1, 2, 3, 4, 5, 6, 12]) add(`col-span-${count}`, `grid-column: span ${count} / span ${count}`);
|
||||
for (const value of [0, 1, 10, 20, 25, 50, 75, 100]) add(`z-${value}`, `z-index: ${value}`);
|
||||
for (const [name, value] of [["xs", "0.75rem"], ["sm", "var(--frost-font-size-sm)"], ["base", "var(--frost-font-size-base)"], ["lg", "var(--frost-font-size-lg)"], ["xl", "var(--frost-font-size-xl)"], ["2xl", "var(--frost-font-size-2xl)"]]) add(`text-${name}`, `font-size: ${value}`);
|
||||
add("transition", "transition: background-color var(--frost-duration-base) var(--frost-ease-standard), border-color var(--frost-duration-base) var(--frost-ease-standard), color var(--frost-duration-base) var(--frost-ease-standard), box-shadow var(--frost-duration-base) var(--frost-ease-standard), transform var(--frost-duration-fast) var(--frost-ease-out)");
|
||||
add("focus-ring", "outline: var(--frost-focus-width) solid var(--frost-focus-color); outline-offset: var(--frost-focus-offset)");
|
||||
|
||||
for (const [variant, pseudo, name, declaration] of [["hover", ":hover", "bg-soft", "background-color: var(--frost-color-surface-soft)"], ["hover", ":hover", "bg-hover", "background-color: var(--frost-color-surface-hover)"], ["hover", ":hover", "text-accent", "color: var(--frost-color-accent-hover)"], ["hover", ":hover", "shadow", "box-shadow: var(--frost-shadow-md)"], ["focus", ":focus-visible", "ring", "outline: var(--frost-focus-width) solid var(--frost-focus-color); outline-offset: var(--frost-focus-offset)"], ["focus", ":focus", "border-accent", "border-color: var(--frost-focus-color)"], ["active", ":active", "translate-y-1", "transform: translateY(1px)"]]) addVariant(variant, name, declaration, pseudo);
|
||||
lines.push(" .frost-disabled\\:opacity:disabled, .frost-disabled\\:opacity[aria-disabled=\"true\"] { opacity: 0.55; }");
|
||||
|
||||
for (const [variant, minWidth] of Object.entries(breakpoints)) {
|
||||
lines.push(` @media (min-width: ${minWidth}) {`);
|
||||
for (const [name, declaration] of declarations.filter(([name]) => ["block", "flex", "grid", "hidden", "flex-row", "flex-col", "items-center", "justify-between", "text-left", "text-center"].includes(name))) addVariant(variant, name, declaration);
|
||||
for (const count of [1, 2, 3, 4, 6, 12]) addVariant(variant, `grid-cols-${count}`, `grid-template-columns: repeat(${count}, minmax(0, 1fr))`);
|
||||
for (const space of ["2", "4", "6", "8", "12"]) { addVariant(variant, `p-${space}`, `padding: var(--frost-space-${space})`); addVariant(variant, `gap-${space}`, `gap: var(--frost-space-${space})`); }
|
||||
lines.push(" }");
|
||||
}
|
||||
lines.push(" @media (prefers-reduced-motion: reduce) { .frost-motion-safe\\:transition { transition: none; } }");
|
||||
lines.push(" @media (prefers-color-scheme: dark) { :root:not([data-theme=\"light\"]) .frost-dark\\:bg-surface { background-color: var(--frost-color-surface); } }");
|
||||
lines.push(" :root[data-theme=\"dark\"] .frost-dark\\:bg-surface { background-color: var(--frost-color-surface); }");
|
||||
lines.push("}");
|
||||
await writeFile(resolve(root, "utilities.css"), `${lines.join("\n")}\n`);
|
||||
console.log(`Generated utilities.css with ${declarations.length} base utilities and ${spaces.length} spacing steps.`);
|
||||
+1
-1
@@ -4,7 +4,7 @@ import { resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = fileURLToPath(new URL("..", import.meta.url));
|
||||
const files = ["tokens.css", "base.css", "accessibility.css", "layout.css", "controls.css", "components.css"];
|
||||
const files = ["tokens.css", "base.css", "accessibility.css", "layout.css", "controls.css", "components.css", "utilities.css"];
|
||||
const source = (await Promise.all(files.map((file) => readFile(resolve(root, file), "utf8")))).join("\n");
|
||||
const rawBytes = Buffer.byteLength(source);
|
||||
const gzipBytes = gzipSync(source).byteLength;
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
--frost-color-warning: #9a5b00;
|
||||
--frost-color-danger: #b42318;
|
||||
--frost-color-info: #1769aa;
|
||||
--frost-color-link: var(--frost-color-accent);
|
||||
--frost-color-link-hover: var(--frost-color-accent-hover);
|
||||
--frost-color-code-bg: var(--frost-color-surface-soft);
|
||||
--frost-color-code-text: var(--frost-color-text);
|
||||
--frost-color-disabled: var(--frost-color-text-muted);
|
||||
--frost-color-on-danger: #ffffff;
|
||||
--frost-color-on-success: #ffffff;
|
||||
--frost-color-on-warning: #172027;
|
||||
@@ -54,6 +59,7 @@
|
||||
--frost-font-size-base: 1rem;
|
||||
--frost-font-size-lg: 1.125rem;
|
||||
--frost-font-size-xl: clamp(1.5rem, 3vw, 2.25rem);
|
||||
--frost-font-size-2xl: clamp(2rem, 5vw, 3.5rem);
|
||||
|
||||
--frost-duration-fast: 150ms;
|
||||
--frost-duration-base: 200ms;
|
||||
@@ -71,6 +77,8 @@
|
||||
--frost-z-modal: 1001;
|
||||
--frost-z-popover: 1010;
|
||||
--frost-z-toast: 1020;
|
||||
--frost-breakpoint-md: 48rem;
|
||||
--frost-breakpoint-lg: 64rem;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
|
||||
+391
@@ -0,0 +1,391 @@
|
||||
@layer frost.utilities {
|
||||
/* Generated by scripts/generate-utilities.mjs. Edit the generator, not this file. */
|
||||
.frost-block { display: block; }
|
||||
.frost-inline-block { display: inline-block; }
|
||||
.frost-inline { display: inline; }
|
||||
.frost-flex { display: flex; }
|
||||
.frost-inline-flex { display: inline-flex; }
|
||||
.frost-grid { display: grid; }
|
||||
.frost-hidden { display: none !important; }
|
||||
.frost-visible { visibility: visible; }
|
||||
.frost-invisible { visibility: hidden; }
|
||||
.frost-relative { position: relative; }
|
||||
.frost-absolute { position: absolute; }
|
||||
.frost-fixed { position: fixed; }
|
||||
.frost-sticky { position: sticky; }
|
||||
.frost-flex-wrap { flex-wrap: wrap; }
|
||||
.frost-flex-nowrap { flex-wrap: nowrap; }
|
||||
.frost-flex-row { flex-direction: row; }
|
||||
.frost-flex-col { flex-direction: column; }
|
||||
.frost-flex-1 { flex: 1 1 0%; }
|
||||
.frost-flex-auto { flex: 1 1 auto; }
|
||||
.frost-flex-none { flex: none; }
|
||||
.frost-grow { flex-grow: 1; }
|
||||
.frost-grow-0 { flex-grow: 0; }
|
||||
.frost-shrink { flex-shrink: 1; }
|
||||
.frost-shrink-0 { flex-shrink: 0; }
|
||||
.frost-min-w-0 { min-width: 0; }
|
||||
.frost-w-full { width: 100%; }
|
||||
.frost-h-full { height: 100%; }
|
||||
.frost-w-screen { width: 100vw; }
|
||||
.frost-h-screen { height: 100vh; }
|
||||
.frost-min-h-screen { min-height: 100vh; }
|
||||
.frost-items-start { align-items: flex-start; }
|
||||
.frost-items-center { align-items: center; }
|
||||
.frost-items-end { align-items: flex-end; }
|
||||
.frost-items-stretch { align-items: stretch; }
|
||||
.frost-justify-start { justify-content: flex-start; }
|
||||
.frost-justify-center { justify-content: center; }
|
||||
.frost-justify-end { justify-content: flex-end; }
|
||||
.frost-justify-between { justify-content: space-between; }
|
||||
.frost-justify-around { justify-content: space-around; }
|
||||
.frost-justify-evenly { justify-content: space-evenly; }
|
||||
.frost-content-center { align-content: center; }
|
||||
.frost-self-start { align-self: flex-start; }
|
||||
.frost-self-center { align-self: center; }
|
||||
.frost-self-end { align-self: flex-end; }
|
||||
.frost-place-items-center { place-items: center; }
|
||||
.frost-text-left { text-align: left; }
|
||||
.frost-text-center { text-align: center; }
|
||||
.frost-text-right { text-align: right; }
|
||||
.frost-text-start { text-align: start; }
|
||||
.frost-text-end { text-align: end; }
|
||||
.frost-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.frost-overflow-hidden { overflow: hidden; }
|
||||
.frost-overflow-auto { overflow: auto; }
|
||||
.frost-overflow-x-auto { overflow-x: auto; }
|
||||
.frost-border { border: 1px solid var(--frost-color-border); }
|
||||
.frost-border-strong { border: 1px solid var(--frost-color-border-strong); }
|
||||
.frost-border-0 { border: 0; }
|
||||
.frost-rounded-sm { border-radius: var(--frost-radius-sm); }
|
||||
.frost-rounded { border-radius: var(--frost-radius-md); }
|
||||
.frost-rounded-lg { border-radius: var(--frost-radius-lg); }
|
||||
.frost-rounded-xl { border-radius: var(--frost-radius-xl); }
|
||||
.frost-rounded-pill { border-radius: var(--frost-radius-pill); }
|
||||
.frost-rounded-full { border-radius: 9999px; }
|
||||
.frost-shadow-sm { box-shadow: var(--frost-shadow-sm); }
|
||||
.frost-shadow { box-shadow: var(--frost-shadow-md); }
|
||||
.frost-shadow-lg { box-shadow: var(--frost-shadow-lg); }
|
||||
.frost-shadow-none { box-shadow: none; }
|
||||
.frost-font-normal { font-weight: 400; }
|
||||
.frost-font-medium { font-weight: 500; }
|
||||
.frost-font-semibold { font-weight: 650; }
|
||||
.frost-font-bold { font-weight: 700; }
|
||||
.frost-font-mono { font-family: var(--frost-font-mono); }
|
||||
.frost-leading-body { line-height: var(--frost-line-height-body); }
|
||||
.frost-leading-heading { line-height: var(--frost-line-height-heading); }
|
||||
.frost-leading-none { line-height: 1; }
|
||||
.frost-uppercase { text-transform: uppercase; }
|
||||
.frost-lowercase { text-transform: lowercase; }
|
||||
.frost-italic { font-style: italic; }
|
||||
.frost-text { color: var(--frost-color-text); }
|
||||
.frost-text-muted { color: var(--frost-color-text-muted); }
|
||||
.frost-text-accent { color: var(--frost-color-accent); }
|
||||
.frost-text-success { color: var(--frost-color-success); }
|
||||
.frost-text-warning { color: var(--frost-color-warning); }
|
||||
.frost-text-danger { color: var(--frost-color-danger); }
|
||||
.frost-text-link { color: var(--frost-color-link); }
|
||||
.frost-bg { background-color: var(--frost-color-bg); }
|
||||
.frost-bg-surface { background-color: var(--frost-color-surface); }
|
||||
.frost-bg-soft { background-color: var(--frost-color-surface-soft); }
|
||||
.frost-bg-accent { background-color: var(--frost-color-accent); color: var(--frost-color-on-accent); }
|
||||
.frost-bg-success { background-color: var(--frost-color-success); color: var(--frost-color-on-success); }
|
||||
.frost-bg-warning { background-color: var(--frost-color-warning); color: var(--frost-color-on-warning); }
|
||||
.frost-bg-danger { background-color: var(--frost-color-danger); color: var(--frost-color-on-danger); }
|
||||
.frost-max-w-sm { max-width: 24rem; }
|
||||
.frost-max-w-md { max-width: 32rem; }
|
||||
.frost-max-w-lg { max-width: 48rem; }
|
||||
.frost-max-w-xl { max-width: 64rem; }
|
||||
.frost-max-w-none { max-width: none; }
|
||||
.frost-opacity-0 { opacity: 0; }
|
||||
.frost-opacity-50 { opacity: 0.5; }
|
||||
.frost-opacity-75 { opacity: 0.75; }
|
||||
.frost-opacity-100 { opacity: 1; }
|
||||
.frost-pointer-events-none { pointer-events: none; }
|
||||
.frost-gap-0 { gap: var(--frost-space-0); }
|
||||
.frost-p-0 { padding: var(--frost-space-0); }
|
||||
.frost-px-0 { padding-inline: var(--frost-space-0); }
|
||||
.frost-py-0 { padding-block: var(--frost-space-0); }
|
||||
.frost-pt-0 { padding-block-start: var(--frost-space-0); }
|
||||
.frost-pr-0 { padding-inline-end: var(--frost-space-0); }
|
||||
.frost-pb-0 { padding-block-end: var(--frost-space-0); }
|
||||
.frost-pl-0 { padding-inline-start: var(--frost-space-0); }
|
||||
.frost-m-0 { margin: var(--frost-space-0); }
|
||||
.frost-mx-0 { margin-inline: var(--frost-space-0); }
|
||||
.frost-my-0 { margin-block: var(--frost-space-0); }
|
||||
.frost-mt-0 { margin-block-start: var(--frost-space-0); }
|
||||
.frost-mr-0 { margin-inline-end: var(--frost-space-0); }
|
||||
.frost-mb-0 { margin-block-end: var(--frost-space-0); }
|
||||
.frost-ml-0 { margin-inline-start: var(--frost-space-0); }
|
||||
.frost-gap-1 { gap: var(--frost-space-1); }
|
||||
.frost-p-1 { padding: var(--frost-space-1); }
|
||||
.frost-px-1 { padding-inline: var(--frost-space-1); }
|
||||
.frost-py-1 { padding-block: var(--frost-space-1); }
|
||||
.frost-pt-1 { padding-block-start: var(--frost-space-1); }
|
||||
.frost-pr-1 { padding-inline-end: var(--frost-space-1); }
|
||||
.frost-pb-1 { padding-block-end: var(--frost-space-1); }
|
||||
.frost-pl-1 { padding-inline-start: var(--frost-space-1); }
|
||||
.frost-m-1 { margin: var(--frost-space-1); }
|
||||
.frost-mx-1 { margin-inline: var(--frost-space-1); }
|
||||
.frost-my-1 { margin-block: var(--frost-space-1); }
|
||||
.frost-mt-1 { margin-block-start: var(--frost-space-1); }
|
||||
.frost-mr-1 { margin-inline-end: var(--frost-space-1); }
|
||||
.frost-mb-1 { margin-block-end: var(--frost-space-1); }
|
||||
.frost-ml-1 { margin-inline-start: var(--frost-space-1); }
|
||||
.frost-gap-2 { gap: var(--frost-space-2); }
|
||||
.frost-p-2 { padding: var(--frost-space-2); }
|
||||
.frost-px-2 { padding-inline: var(--frost-space-2); }
|
||||
.frost-py-2 { padding-block: var(--frost-space-2); }
|
||||
.frost-pt-2 { padding-block-start: var(--frost-space-2); }
|
||||
.frost-pr-2 { padding-inline-end: var(--frost-space-2); }
|
||||
.frost-pb-2 { padding-block-end: var(--frost-space-2); }
|
||||
.frost-pl-2 { padding-inline-start: var(--frost-space-2); }
|
||||
.frost-m-2 { margin: var(--frost-space-2); }
|
||||
.frost-mx-2 { margin-inline: var(--frost-space-2); }
|
||||
.frost-my-2 { margin-block: var(--frost-space-2); }
|
||||
.frost-mt-2 { margin-block-start: var(--frost-space-2); }
|
||||
.frost-mr-2 { margin-inline-end: var(--frost-space-2); }
|
||||
.frost-mb-2 { margin-block-end: var(--frost-space-2); }
|
||||
.frost-ml-2 { margin-inline-start: var(--frost-space-2); }
|
||||
.frost-gap-3 { gap: var(--frost-space-3); }
|
||||
.frost-p-3 { padding: var(--frost-space-3); }
|
||||
.frost-px-3 { padding-inline: var(--frost-space-3); }
|
||||
.frost-py-3 { padding-block: var(--frost-space-3); }
|
||||
.frost-pt-3 { padding-block-start: var(--frost-space-3); }
|
||||
.frost-pr-3 { padding-inline-end: var(--frost-space-3); }
|
||||
.frost-pb-3 { padding-block-end: var(--frost-space-3); }
|
||||
.frost-pl-3 { padding-inline-start: var(--frost-space-3); }
|
||||
.frost-m-3 { margin: var(--frost-space-3); }
|
||||
.frost-mx-3 { margin-inline: var(--frost-space-3); }
|
||||
.frost-my-3 { margin-block: var(--frost-space-3); }
|
||||
.frost-mt-3 { margin-block-start: var(--frost-space-3); }
|
||||
.frost-mr-3 { margin-inline-end: var(--frost-space-3); }
|
||||
.frost-mb-3 { margin-block-end: var(--frost-space-3); }
|
||||
.frost-ml-3 { margin-inline-start: var(--frost-space-3); }
|
||||
.frost-gap-4 { gap: var(--frost-space-4); }
|
||||
.frost-p-4 { padding: var(--frost-space-4); }
|
||||
.frost-px-4 { padding-inline: var(--frost-space-4); }
|
||||
.frost-py-4 { padding-block: var(--frost-space-4); }
|
||||
.frost-pt-4 { padding-block-start: var(--frost-space-4); }
|
||||
.frost-pr-4 { padding-inline-end: var(--frost-space-4); }
|
||||
.frost-pb-4 { padding-block-end: var(--frost-space-4); }
|
||||
.frost-pl-4 { padding-inline-start: var(--frost-space-4); }
|
||||
.frost-m-4 { margin: var(--frost-space-4); }
|
||||
.frost-mx-4 { margin-inline: var(--frost-space-4); }
|
||||
.frost-my-4 { margin-block: var(--frost-space-4); }
|
||||
.frost-mt-4 { margin-block-start: var(--frost-space-4); }
|
||||
.frost-mr-4 { margin-inline-end: var(--frost-space-4); }
|
||||
.frost-mb-4 { margin-block-end: var(--frost-space-4); }
|
||||
.frost-ml-4 { margin-inline-start: var(--frost-space-4); }
|
||||
.frost-gap-5 { gap: var(--frost-space-5); }
|
||||
.frost-p-5 { padding: var(--frost-space-5); }
|
||||
.frost-px-5 { padding-inline: var(--frost-space-5); }
|
||||
.frost-py-5 { padding-block: var(--frost-space-5); }
|
||||
.frost-pt-5 { padding-block-start: var(--frost-space-5); }
|
||||
.frost-pr-5 { padding-inline-end: var(--frost-space-5); }
|
||||
.frost-pb-5 { padding-block-end: var(--frost-space-5); }
|
||||
.frost-pl-5 { padding-inline-start: var(--frost-space-5); }
|
||||
.frost-m-5 { margin: var(--frost-space-5); }
|
||||
.frost-mx-5 { margin-inline: var(--frost-space-5); }
|
||||
.frost-my-5 { margin-block: var(--frost-space-5); }
|
||||
.frost-mt-5 { margin-block-start: var(--frost-space-5); }
|
||||
.frost-mr-5 { margin-inline-end: var(--frost-space-5); }
|
||||
.frost-mb-5 { margin-block-end: var(--frost-space-5); }
|
||||
.frost-ml-5 { margin-inline-start: var(--frost-space-5); }
|
||||
.frost-gap-6 { gap: var(--frost-space-6); }
|
||||
.frost-p-6 { padding: var(--frost-space-6); }
|
||||
.frost-px-6 { padding-inline: var(--frost-space-6); }
|
||||
.frost-py-6 { padding-block: var(--frost-space-6); }
|
||||
.frost-pt-6 { padding-block-start: var(--frost-space-6); }
|
||||
.frost-pr-6 { padding-inline-end: var(--frost-space-6); }
|
||||
.frost-pb-6 { padding-block-end: var(--frost-space-6); }
|
||||
.frost-pl-6 { padding-inline-start: var(--frost-space-6); }
|
||||
.frost-m-6 { margin: var(--frost-space-6); }
|
||||
.frost-mx-6 { margin-inline: var(--frost-space-6); }
|
||||
.frost-my-6 { margin-block: var(--frost-space-6); }
|
||||
.frost-mt-6 { margin-block-start: var(--frost-space-6); }
|
||||
.frost-mr-6 { margin-inline-end: var(--frost-space-6); }
|
||||
.frost-mb-6 { margin-block-end: var(--frost-space-6); }
|
||||
.frost-ml-6 { margin-inline-start: var(--frost-space-6); }
|
||||
.frost-gap-8 { gap: var(--frost-space-8); }
|
||||
.frost-p-8 { padding: var(--frost-space-8); }
|
||||
.frost-px-8 { padding-inline: var(--frost-space-8); }
|
||||
.frost-py-8 { padding-block: var(--frost-space-8); }
|
||||
.frost-pt-8 { padding-block-start: var(--frost-space-8); }
|
||||
.frost-pr-8 { padding-inline-end: var(--frost-space-8); }
|
||||
.frost-pb-8 { padding-block-end: var(--frost-space-8); }
|
||||
.frost-pl-8 { padding-inline-start: var(--frost-space-8); }
|
||||
.frost-m-8 { margin: var(--frost-space-8); }
|
||||
.frost-mx-8 { margin-inline: var(--frost-space-8); }
|
||||
.frost-my-8 { margin-block: var(--frost-space-8); }
|
||||
.frost-mt-8 { margin-block-start: var(--frost-space-8); }
|
||||
.frost-mr-8 { margin-inline-end: var(--frost-space-8); }
|
||||
.frost-mb-8 { margin-block-end: var(--frost-space-8); }
|
||||
.frost-ml-8 { margin-inline-start: var(--frost-space-8); }
|
||||
.frost-gap-10 { gap: var(--frost-space-10); }
|
||||
.frost-p-10 { padding: var(--frost-space-10); }
|
||||
.frost-px-10 { padding-inline: var(--frost-space-10); }
|
||||
.frost-py-10 { padding-block: var(--frost-space-10); }
|
||||
.frost-pt-10 { padding-block-start: var(--frost-space-10); }
|
||||
.frost-pr-10 { padding-inline-end: var(--frost-space-10); }
|
||||
.frost-pb-10 { padding-block-end: var(--frost-space-10); }
|
||||
.frost-pl-10 { padding-inline-start: var(--frost-space-10); }
|
||||
.frost-m-10 { margin: var(--frost-space-10); }
|
||||
.frost-mx-10 { margin-inline: var(--frost-space-10); }
|
||||
.frost-my-10 { margin-block: var(--frost-space-10); }
|
||||
.frost-mt-10 { margin-block-start: var(--frost-space-10); }
|
||||
.frost-mr-10 { margin-inline-end: var(--frost-space-10); }
|
||||
.frost-mb-10 { margin-block-end: var(--frost-space-10); }
|
||||
.frost-ml-10 { margin-inline-start: var(--frost-space-10); }
|
||||
.frost-gap-12 { gap: var(--frost-space-12); }
|
||||
.frost-p-12 { padding: var(--frost-space-12); }
|
||||
.frost-px-12 { padding-inline: var(--frost-space-12); }
|
||||
.frost-py-12 { padding-block: var(--frost-space-12); }
|
||||
.frost-pt-12 { padding-block-start: var(--frost-space-12); }
|
||||
.frost-pr-12 { padding-inline-end: var(--frost-space-12); }
|
||||
.frost-pb-12 { padding-block-end: var(--frost-space-12); }
|
||||
.frost-pl-12 { padding-inline-start: var(--frost-space-12); }
|
||||
.frost-m-12 { margin: var(--frost-space-12); }
|
||||
.frost-mx-12 { margin-inline: var(--frost-space-12); }
|
||||
.frost-my-12 { margin-block: var(--frost-space-12); }
|
||||
.frost-mt-12 { margin-block-start: var(--frost-space-12); }
|
||||
.frost-mr-12 { margin-inline-end: var(--frost-space-12); }
|
||||
.frost-mb-12 { margin-block-end: var(--frost-space-12); }
|
||||
.frost-ml-12 { margin-inline-start: var(--frost-space-12); }
|
||||
.frost-gap-16 { gap: var(--frost-space-16); }
|
||||
.frost-p-16 { padding: var(--frost-space-16); }
|
||||
.frost-px-16 { padding-inline: var(--frost-space-16); }
|
||||
.frost-py-16 { padding-block: var(--frost-space-16); }
|
||||
.frost-pt-16 { padding-block-start: var(--frost-space-16); }
|
||||
.frost-pr-16 { padding-inline-end: var(--frost-space-16); }
|
||||
.frost-pb-16 { padding-block-end: var(--frost-space-16); }
|
||||
.frost-pl-16 { padding-inline-start: var(--frost-space-16); }
|
||||
.frost-m-16 { margin: var(--frost-space-16); }
|
||||
.frost-mx-16 { margin-inline: var(--frost-space-16); }
|
||||
.frost-my-16 { margin-block: var(--frost-space-16); }
|
||||
.frost-mt-16 { margin-block-start: var(--frost-space-16); }
|
||||
.frost-mr-16 { margin-inline-end: var(--frost-space-16); }
|
||||
.frost-mb-16 { margin-block-end: var(--frost-space-16); }
|
||||
.frost-ml-16 { margin-inline-start: var(--frost-space-16); }
|
||||
.frost-mx-auto { margin-inline: auto; }
|
||||
.frost-my-auto { margin-block: auto; }
|
||||
.frost-space-y-0 { --frost-space-y: 0; }
|
||||
.frost-space-y-1 { --frost-space-y: var(--frost-space-1); }
|
||||
.frost-space-y-2 { --frost-space-y: var(--frost-space-2); }
|
||||
.frost-space-y-3 { --frost-space-y: var(--frost-space-3); }
|
||||
.frost-space-y-4 { --frost-space-y: var(--frost-space-4); }
|
||||
.frost-space-y-5 { --frost-space-y: var(--frost-space-5); }
|
||||
.frost-space-y-6 { --frost-space-y: var(--frost-space-6); }
|
||||
.frost-space-y-8 { --frost-space-y: var(--frost-space-8); }
|
||||
.frost-space-y-10 { --frost-space-y: var(--frost-space-10); }
|
||||
.frost-space-y-12 { --frost-space-y: var(--frost-space-12); }
|
||||
.frost-space-y-16 { --frost-space-y: var(--frost-space-16); }
|
||||
.frost-space-y-0 > :not([hidden]) ~ :not([hidden]) { margin-block-start: 0; }
|
||||
.frost-space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-1); }
|
||||
.frost-space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-2); }
|
||||
.frost-space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-3); }
|
||||
.frost-space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-4); }
|
||||
.frost-space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-5); }
|
||||
.frost-space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-6); }
|
||||
.frost-space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-8); }
|
||||
.frost-space-y-10 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-10); }
|
||||
.frost-space-y-12 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-12); }
|
||||
.frost-space-y-16 > :not([hidden]) ~ :not([hidden]) { margin-block-start: var(--frost-space-16); }
|
||||
.frost-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
|
||||
.frost-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.frost-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
||||
.frost-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
||||
.frost-grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
|
||||
.frost-grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
|
||||
.frost-grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
|
||||
.frost-col-span-1 { grid-column: span 1 / span 1; }
|
||||
.frost-col-span-2 { grid-column: span 2 / span 2; }
|
||||
.frost-col-span-3 { grid-column: span 3 / span 3; }
|
||||
.frost-col-span-4 { grid-column: span 4 / span 4; }
|
||||
.frost-col-span-5 { grid-column: span 5 / span 5; }
|
||||
.frost-col-span-6 { grid-column: span 6 / span 6; }
|
||||
.frost-col-span-12 { grid-column: span 12 / span 12; }
|
||||
.frost-z-0 { z-index: 0; }
|
||||
.frost-z-1 { z-index: 1; }
|
||||
.frost-z-10 { z-index: 10; }
|
||||
.frost-z-20 { z-index: 20; }
|
||||
.frost-z-25 { z-index: 25; }
|
||||
.frost-z-50 { z-index: 50; }
|
||||
.frost-z-75 { z-index: 75; }
|
||||
.frost-z-100 { z-index: 100; }
|
||||
.frost-text-xs { font-size: 0.75rem; }
|
||||
.frost-text-sm { font-size: var(--frost-font-size-sm); }
|
||||
.frost-text-base { font-size: var(--frost-font-size-base); }
|
||||
.frost-text-lg { font-size: var(--frost-font-size-lg); }
|
||||
.frost-text-xl { font-size: var(--frost-font-size-xl); }
|
||||
.frost-text-2xl { font-size: var(--frost-font-size-2xl); }
|
||||
.frost-transition { transition: background-color var(--frost-duration-base) var(--frost-ease-standard), border-color var(--frost-duration-base) var(--frost-ease-standard), color var(--frost-duration-base) var(--frost-ease-standard), box-shadow var(--frost-duration-base) var(--frost-ease-standard), transform var(--frost-duration-fast) var(--frost-ease-out); }
|
||||
.frost-focus-ring { outline: var(--frost-focus-width) solid var(--frost-focus-color); outline-offset: var(--frost-focus-offset); }
|
||||
.frost-hover\:bg-soft:hover { background-color: var(--frost-color-surface-soft); }
|
||||
.frost-hover\:bg-hover:hover { background-color: var(--frost-color-surface-hover); }
|
||||
.frost-hover\:text-accent:hover { color: var(--frost-color-accent-hover); }
|
||||
.frost-hover\:shadow:hover { box-shadow: var(--frost-shadow-md); }
|
||||
.frost-focus\:ring:focus-visible { outline: var(--frost-focus-width) solid var(--frost-focus-color); outline-offset: var(--frost-focus-offset); }
|
||||
.frost-focus\:border-accent:focus { border-color: var(--frost-focus-color); }
|
||||
.frost-active\:translate-y-1:active { transform: translateY(1px); }
|
||||
.frost-disabled\:opacity:disabled, .frost-disabled\:opacity[aria-disabled="true"] { opacity: 0.55; }
|
||||
@media (min-width: 48rem) {
|
||||
.frost-md\:block { display: block; }
|
||||
.frost-md\:flex { display: flex; }
|
||||
.frost-md\:grid { display: grid; }
|
||||
.frost-md\:hidden { display: none !important; }
|
||||
.frost-md\:flex-row { flex-direction: row; }
|
||||
.frost-md\:flex-col { flex-direction: column; }
|
||||
.frost-md\:items-center { align-items: center; }
|
||||
.frost-md\:justify-between { justify-content: space-between; }
|
||||
.frost-md\:text-left { text-align: left; }
|
||||
.frost-md\:text-center { text-align: center; }
|
||||
.frost-md\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
|
||||
.frost-md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.frost-md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
||||
.frost-md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
||||
.frost-md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
|
||||
.frost-md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
|
||||
.frost-md\:p-2 { padding: var(--frost-space-2); }
|
||||
.frost-md\:gap-2 { gap: var(--frost-space-2); }
|
||||
.frost-md\:p-4 { padding: var(--frost-space-4); }
|
||||
.frost-md\:gap-4 { gap: var(--frost-space-4); }
|
||||
.frost-md\:p-6 { padding: var(--frost-space-6); }
|
||||
.frost-md\:gap-6 { gap: var(--frost-space-6); }
|
||||
.frost-md\:p-8 { padding: var(--frost-space-8); }
|
||||
.frost-md\:gap-8 { gap: var(--frost-space-8); }
|
||||
.frost-md\:p-12 { padding: var(--frost-space-12); }
|
||||
.frost-md\:gap-12 { gap: var(--frost-space-12); }
|
||||
}
|
||||
@media (min-width: 64rem) {
|
||||
.frost-lg\:block { display: block; }
|
||||
.frost-lg\:flex { display: flex; }
|
||||
.frost-lg\:grid { display: grid; }
|
||||
.frost-lg\:hidden { display: none !important; }
|
||||
.frost-lg\:flex-row { flex-direction: row; }
|
||||
.frost-lg\:flex-col { flex-direction: column; }
|
||||
.frost-lg\:items-center { align-items: center; }
|
||||
.frost-lg\:justify-between { justify-content: space-between; }
|
||||
.frost-lg\:text-left { text-align: left; }
|
||||
.frost-lg\:text-center { text-align: center; }
|
||||
.frost-lg\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
|
||||
.frost-lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.frost-lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
||||
.frost-lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
||||
.frost-lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
|
||||
.frost-lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
|
||||
.frost-lg\:p-2 { padding: var(--frost-space-2); }
|
||||
.frost-lg\:gap-2 { gap: var(--frost-space-2); }
|
||||
.frost-lg\:p-4 { padding: var(--frost-space-4); }
|
||||
.frost-lg\:gap-4 { gap: var(--frost-space-4); }
|
||||
.frost-lg\:p-6 { padding: var(--frost-space-6); }
|
||||
.frost-lg\:gap-6 { gap: var(--frost-space-6); }
|
||||
.frost-lg\:p-8 { padding: var(--frost-space-8); }
|
||||
.frost-lg\:gap-8 { gap: var(--frost-space-8); }
|
||||
.frost-lg\:p-12 { padding: var(--frost-space-12); }
|
||||
.frost-lg\:gap-12 { gap: var(--frost-space-12); }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) { .frost-motion-safe\:transition { transition: none; } }
|
||||
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .frost-dark\:bg-surface { background-color: var(--frost-color-surface); } }
|
||||
:root[data-theme="dark"] .frost-dark\:bg-surface { background-color: var(--frost-color-surface); }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
@layer frost.tokens, frost.base, frost.accessibility, frost.layout, frost.utilities;
|
||||
|
||||
@import url("./core.css");
|
||||
@import url("./layout.css") layer(frost.layout);
|
||||
@import url("./utilities.css") layer(frost.utilities);
|
||||
Reference in New Issue
Block a user