diff --git a/index.html b/index.html new file mode 100644 index 0000000..95446c0 --- /dev/null +++ b/index.html @@ -0,0 +1,225 @@ + + + + + + + Meet Kanso.css + + + + + + + +
+ +
+ +
+ +

Meet Kanso.css

+ +

A classless CSS template for simple forms and web pages.

+ +

+ I've always wanted a minimal CSS template that I can customize for each project, as opposed to starting + from a blank CSS file. +

+ +

Which is why I created Kanso.css.

+ +

+ In Japanese, Kanso translates to simplicity or purity, advocating for the elimination of the unnecessary. I + wanted a template that reflected this philosophy, offering a clean, minimal, and distraction-free + experience that can be added onto. +

+ +

Features

+ +

+ Sticking to its core principles, Kanso.css minimizes its number of declarations, whilst being responsive + and easily customizable. +

+ +

At less than 100 lines, Kanso.css is a tiny 1.3 KB in size.

+ +

Works as a standalone classless CSS framework, but can be added onto and tailored for specific projects.

+ +

Font and colors are stored as global variables, making it easy to theme Kanso.css.

+ +

Comes with a dark theme by default.

+ +

+ + + +

Installation

+ +

1. Serve Locally

+ +

The recommended way to install Kanso.css is to save it locally.

+ +

This method allows you to customize and tailor Kanso.css.

+ + + + + +

2. jsDeliver CDN

+ +

You can apply the default Kanso.css to your site by adding the following link tag within your head tag.

+ + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/nightmono/kanso.css@main/kanso.css"> + +

Theming and Customization

+ +

The font and colors are changable as global root variables.

+ +

+ Kanso.css uses 4 colors:
+ --fg1 for text color,
+ --fg2 for outlines,
+ --bg1 for background color,
+ --bg2 for background color of buttons and text input. +

+ +

Below is the color scheme example for the dark mode theme:

+ +

:root { --fg1: #eee; --fg2: #555; --bg1: #181818; --bg2: #282828; }

+ +

Because the size of Kanso.css is so small, you can add any custom CSS directly onto the file itself.

+ +

+ Alternatively, you can load your own stylesheet after Kanso.css, overriding any conflicting declarations + Kanso.css has with yours. +

+ +

Demo Forms

+ +

XOR Mask

+

+ + +

+

+ + +

+

+ +

+

+ + +

+ + + +
+

Message

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + + + +

+

+ + +

+

+ +

+ + + + +
+ +
+ + + + + + \ No newline at end of file diff --git a/kanso.css b/kanso.css new file mode 100644 index 0000000..30a36a3 --- /dev/null +++ b/kanso.css @@ -0,0 +1,90 @@ +:root { + --font: sans-serif; + --fg1: #222; + --fg2: #888; + --bg1: #f8f8f8; + --bg2: #eee; +} + +@media (prefers-color-scheme: dark) { + :root { + --fg1: #eee; + --fg2: #555; + --bg1: #181818; + --bg2: #282828; + } +} + +* { + box-sizing: border-box; + scroll-behavior: smooth; +} + +body { + color: var(--fg1); + background-color: var(--bg1); + font-family: var(--font); + line-height: 1.5; + margin: 0 auto; + max-width: 500px; + padding: 2rem 1rem 1rem; + box-sizing: content-box; +} + +a { + color: var(--fg1); + font-weight: 600; +} + +small { + font: inherit; + color: var(--fg2); +} + +label { + display: block; + margin-bottom: 0.5rem; +} + +textarea, +input, +select, +button { + font: inherit; + color: var(--fg1); + padding: 0.25rem 0.5rem; + background-color: var(--bg2); + border: 1px solid var(--fg2); + border-radius: 4px; +} + +textarea, +input[type="text"], +input[type="email"] { + width: 100%; + max-width: 100%; +} + +button { + font-weight: 600; + padding: 0.5rem 1rem; + border-radius: 8px; + transition: all .2s; +} + +button[type="submit"] { + color: var(--bg1); + background-color: var(--fg1); + border-color: var(--fg1); +} + +button:disabled { + color: var(--fg2); + background-color: var(--bg2); + border: var(--bg2); + cursor: not-allowed; +} + +button:hover { + opacity: .8; +}