Nercone Design
The design system of nercone.dev: one stylesheet, one script, and a theme. Write plain HTML, and add classes only where needed.
Getting started
Load style.css, a theme, and script.js. noscript.css is loaded only when JavaScript is disabled.
<link rel="stylesheet" href="https://assets.nercone.dev/style.css">
<link rel="stylesheet" href="https://assets.nercone.dev/styles/themes/auto-stark.css">
<noscript>
<link rel="stylesheet" href="https://assets.nercone.dev/styles/noscript.css">
</noscript>
<script src="https://assets.nercone.dev/script.js" defer></script>style.css defines the palette, but not the colors by purpose such as --color-foreground and --color-background. They come from the theme, so always load one. See Themes.
Most elements need no class. <button>, <input>, <select>, <textarea>, <table>, <details>, and <dialog> are styled as they are. Classes such as button and table give the same look to other elements.
<main>
<div class="hero">
<h1>Title</h1>
<p>Subtitle</p>
</div>
<p>Text</p>
<button class="button-primary" type="button">Save</button>
</main>Files
style.css and script.js are bundles. The server joins the files below in the order of their entry files, styles/index.css and scripts/index.js. Each theme in styles/themes/ is a separate stylesheet.
| Path | Contents |
|---|---|
styles/color.css | Palette, brightness, opacity, JIS safety colors, and color utility classes |
styles/font.css | Fonts, inline elements, and font utility classes |
styles/layout.css | Spacing and flex utility classes |
styles/main.css | <html>, <body>, <header>, <main>, headings, and lists |
styles/misc.css | Border, selection, and overflow utility classes |
styles/responsive-design.css | hide, show, and the small:, medium:, and large: variants |
styles/components/*.css | One file for each component |
styles/themes/*.css | Colors by purpose. Not part of style.css |
styles/noscript.css | Rules for pages without JavaScript. Not part of style.css |
scripts/initializer.js | window.nercone, which the other scripts use |
scripts/theme.js | Changes the theme while the page is open |
scripts/components/*.js | One file for each component that needs a script |
Principles
- Plain HTML first. Native elements and attributes, such as
<dialog>,popover,commandfor, andclosedby, do the work wherever browsers support them. Scripts only fill the gaps. - Pages work without JavaScript. Controls that cannot work without it get the
script-onlyclass, whichnoscript.csshides. - Square corners and 1px borders. Areas are told apart by a border (
block) or a translucent background (layer), not by shadows. - Every size and color is a custom property, so it can be changed for one element and its descendants without new classes.
- Animations are short. Popups, toasts, details, the sidebar, page transitions, and the loading overlay drop their animations when the system prefers reduced motion.
Pages
Palette, brightness, opacity, JIS safety colors, colors by purpose, utility classes, and swatches.
Dark, light, black, white, their UD variants, the automatic themes, and theme.js.
Font families, text elements, code, and font utility classes.
Page structure, sidebar, hero, block, layer, details, grid, and layout utility classes.
Button, text field, dropdown, slider, and segmented control.
Tables, variants, numeric cells, and horizontal scrolling.
Linear, circular, and logo progress indicators.
Stat, gauge, chart, heatmap, stack bar, badge, description list, and binding data to elements.
Popup and toast.
window.nercone, features and their options, cursor, loading overlay, and page transitions.