# 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
```
For a CSS-aware build:
```css
@import "./frost/frost.css";
```
For npm-based projects:
```bash
npm install @fretuks/frost
```
```css
@import "@fretuks/frost";
```
## Basic usage
```html
```
`frost-stack`, `frost-row`, and `frost-grid` expose local custom properties for gap customization:
```html
...
```
Compact and icon controls are available when a project needs smaller repeated actions:
```html
```
## Forms
```html
```
## Themes
Without an explicit theme, Frost follows `prefers-color-scheme`. Explicit themes override that behavior:
```html
```
or:
```html
```
Frost does not require JavaScript; a theme switcher can be added later by Iceberg or ordinary vanilla JavaScript.
Projects with additional themes should override Frost's semantic roles rather than reaching into component selectors:
```css
body.theme-blue {
--frost-color-bg: #071a2b;
--frost-color-surface: #0d2a40;
--frost-color-text: #e8f5ff;
--frost-color-accent: #55b9ff;
--frost-color-accent-hover: #8bd1ff;
}
```
`--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.
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:
```css
[data-theme="ocean"] {
--frost-color-bg: #071a2b;
--frost-color-surface: #0d2a40;
--frost-color-text: #e8f5ff;
--frost-color-accent: #55b9ff;
--frost-color-accent-hover: #8bd1ff;
--frost-color-border: #24516b;
}
```
```html
Confirm
Continue?
```
## Menus, popovers, and 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:
```html
```
Tooltips use `data-frost-tooltip` and should supplement, never replace, an accessible label:
```html
```
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.
## Responsive utilities
`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.
## 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.
## Package maintenance
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.
```bash
npm run lint
npm run size
npm pack --dry-run
```
## 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.