Getting Started
Overview
The reference for kt-styles: every element, live, in light and dark mode. Pick an element from the sidebar; the markup to copy is in that page's source.
Usage
Link the bundled stylesheet in the page's <head> (one file, built automatically from css/ on every push):
<link rel="stylesheet" href="https://koraytugay.github.io/kt-styles/dist/kt.min.css">
Then build the page with kt- classes and --kt- variables. Because of the prefix, the library can also be added to an existing page without clashing with the styles it already has.
Dark mode:
document.documentElement.dataset.theme = 'dark'.
For older pages, adding the dark-mode class to body also works.
Starter page
A minimal page skeleton built only from library classes:
Page title
Subtitle
12
Total
3
Pending
What's inside
| Layer | File | Contents |
|---|---|---|
| Tokens | css/tokens.css | Colors, fonts, sizes, spacing, radii and shadows, for light and dark mode. |
| Base | css/base.css | Reset and default styles for plain HTML elements. |
| Typography | css/typography.css | Headings, page header, text roles, inline elements. |
| Layout | css/layout.css | Container, responsive grid with view modes, vertical stack and wrapping row. |
| Components | css/components/*.css | One file per component. |
| Utilities | css/utilities.css | Small single-purpose helpers: text color and size, fixed-width digits, truncation. |