92 lines
2.2 KiB
Markdown
92 lines
2.2 KiB
Markdown
# Frost CSS Framework
|
|
|
|
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.
|
|
|
|
## Installation
|
|
|
|
For a static site:
|
|
|
|
```html
|
|
<link rel="stylesheet" href="frost/frost.css">
|
|
```
|
|
|
|
For a CSS-aware build:
|
|
|
|
```css
|
|
@import "./frost/frost.css";
|
|
```
|
|
|
|
## Basic usage
|
|
|
|
```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>
|
|
</section>
|
|
</main>
|
|
```
|
|
|
|
## Layout
|
|
|
|
```html
|
|
<div class="frost-grid" style="--frost-grid-min: 14rem">
|
|
<article class="frost-card">One</article>
|
|
<article class="frost-card">Two</article>
|
|
</div>
|
|
```
|
|
|
|
`frost-stack`, `frost-row`, and `frost-grid` expose local custom properties for gap customization:
|
|
|
|
```html
|
|
<div class="frost-stack" style="--frost-stack-gap: var(--frost-space-8)">
|
|
...
|
|
</div>
|
|
```
|
|
|
|
## Forms
|
|
|
|
```html
|
|
<label class="frost-field">
|
|
<span class="frost-label">Email</span>
|
|
<input class="frost-input" type="email" autocomplete="email">
|
|
<span class="frost-help">We will only use this for account notifications.</span>
|
|
</label>
|
|
```
|
|
|
|
## Themes
|
|
|
|
Without an explicit theme, Frost follows `prefers-color-scheme`. Explicit themes override that behavior:
|
|
|
|
```html
|
|
<html data-theme="dark">
|
|
```
|
|
|
|
or:
|
|
|
|
```html
|
|
<html data-theme="light">
|
|
```
|
|
|
|
Frost does not require JavaScript; a theme switcher can be added later by Iceberg or ordinary vanilla JavaScript.
|
|
|
|
## Customization
|
|
|
|
Override semantic tokens in the project layer:
|
|
|
|
```css
|
|
:root {
|
|
--frost-color-accent: #0f766e;
|
|
--frost-container-max: 68rem;
|
|
--frost-radius-md: 0.5rem;
|
|
}
|
|
```
|
|
|
|
The public API uses the `frost-` class prefix and `--frost-*` custom-property prefix to reduce collisions with project CSS and third-party libraries.
|
|
|
|
## Philosophy
|
|
|
|
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.
|
|
|