new.css
<div readability="5"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>new.css</title><meta name="description" content="A classless CSS framework to write modern websites using only HTML."/><meta name="keywords" content="newcss,new.css,css,xz,css framework,classless css,xz.style"/><meta property="og:title" content="new.css"/><meta property="og:url" content="https://newcss.net"/><meta property="og:description" content="A classless CSS framework to write modern websites using only HTML."/><meta property="og:type" content="website"/><meta property="og:image" content="https://newcss.net/assets/og.png"/><link rel="stylesheet" href="/new.min.css"/></head><body id="readabilityBody" readability="76.821717366192">
<header>
<nav><a href="https://newcss.net" style="color: inherit; text-decoration: none;" name="readabilityLink-1">Home</a><a href="#readabilityFootnoteLink-1" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[1]</sup></small></a> / <a href="https://github.com/xz/new.css" style="color: inherit; text-decoration: none;" name="readabilityLink-2">GitHub</a><a href="#readabilityFootnoteLink-2" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[2]</sup></small></a> / <a href="https://discord.gg/hhuuC4w" style="color: inherit; text-decoration: none;" name="readabilityLink-3">Discord</a><a href="#readabilityFootnoteLink-3" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[3]</sup></small></a>
</nav></header><blockquote>
<i>This site is made from vanilla HTML and the default new.css theme. <a href="https://github.com/xz/new.css/blob/master/index.html" style="color: inherit; text-decoration: none;" name="readabilityLink-4">View Source</a><a href="#readabilityFootnoteLink-4" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[4]</sup></small></a></i>
</blockquote>
<p>A classless CSS framework to write modern websites using only HTML. It weighs<strong>~4.5kb</strong>.</p>
<p><strong>View a demo <a href="https://newcss.net/demo/" style="color: inherit; text-decoration: none;" name="readabilityLink-5">here</a><a href="#readabilityFootnoteLink-5" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[5]</sup></small></a>, or the quick-start guide <a href="https://newcss.net/quickstart/" style="color: inherit; text-decoration: none;" name="readabilityLink-6">here</a><a href="#readabilityFootnoteLink-6" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[6]</sup></small></a>.</strong></p>
<p><a href="https://vercel.com?utmsource=xz&utmcampaign=new.css" style="color: inherit; text-decoration: none;" name="readabilityLink-7">Vercel</a><a href="#readabilityFootnoteLink-7" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[7]</sup></small></a>'s impossibly fast CDN delivers new.css and the font <a href="https://rsms.me/inter" style="color: inherit; text-decoration: none;" name="readabilityLink-8">Inter</a><a href="#readabilityFootnoteLink-8" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[8]</sup></small></a> using <a href="https://github.com/xz/fonts" style="color: inherit; text-decoration: none;" name="readabilityLink-9">xz/fonts</a><a href="#readabilityFootnoteLink-9" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[9]</sup></small></a>, so there's virtually no bloat added to your pages.</p>
<p>And of course, there's a dark mode. It automatically applies a light/dark theme based on your browser's preference.</p>
<p>It supports custom color themes and fonts using CSS variables. For example, check out the terminal theme: <a href="https://newcss.net/theme/terminal/" style="color: inherit; text-decoration: none;" name="readabilityLink-10">newcss.net/theme/terminal/</a><a href="#readabilityFootnoteLink-10" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[10]</sup></small></a></p>
<p>new.css is a project from <a href="https://xz.style">xz</a>.</p>
<br/><h2 id="table-of-contents">Table of Contents</h2>
<br/><h2 id="usage">Usage</h2>
<p>Here's your configuration:</p>
<ol><li>Add <code><link rel="stylesheet" href="https://newcss.net/new.min.css"></code> to your <code><head></code>.</li>
<li>Done.</li>
</ol><blockquote readability="7">
<p>💡 Use the code <code><link rel="stylesheet" href="https://newcss.net/lite.css"></code> for the lite version, which uses the system font stack rather than importing one.</p>
</blockquote>
<br/><h2 id="use-cases">Use Cases</h2>
<ul><li>A dead-simple blog</li>
<li>Collecting your most used links</li>
<li>Making a simple "about me" site</li>
<li>Rendering markdown-generated HTML</li>
</ul><br/><h2 id="details">Details</h2>
<p>Here are the improvements new.css adds to your browser's basic HTML.</p>
<details><summary>Full Changes</summary><ul><li><strong>Global</strong>
<ul><li>Slightly increase all text sizes</li>
<li>Use a less harsh color scheme</li>
<li>Use the Inter font, and if not possible, the system font</li>
<li>Redefine all margins to more sensible defaults</li>
</ul></li>
<li><code>body</code>
<ul><li>Set a reasonable max width</li>
<li>Centered the body element, keeping left-alignment</li>
</ul></li>
<li><code>abbr</code>
<ul><li>Question mark cursor on hover</li>
</ul></li>
<li><code>blockquote</code>
<ul><li>Improved margins</li>
<li>Added background color</li>
</ul></li>
<li><code>button</code>
<ul><li>Appears uniformly across browsers</li>
<li>Looks like a real button</li>
</ul></li>
<li><code>code</code>
<ul><li>Added background color</li>
<li>Added outline stroke</li>
</ul></li>
<li><code>details</code>
<ul><li>Looks more button-like with background color and link cursor
on hover</li>
</ul></li>
<li><code>h1</code>–<code>h6</code>
<ul><li>Uniform margins and padding</li>
<li>Tweaked font size</li>
</ul></li>
<li><code>h1-h3</code>
<ul><li>Added thin bottom border line</li>
</ul></li>
<li><code>header</code>
<ul><li>Makes a screen-wide slightly darker header bar. Only use at the top of the <code><body></code>!</li>
</ul></li>
<li><code>hr</code>
<ul><li>Changed to single 1px line</li>
</ul></li>
<li><code>kbd</code>
<ul><li>Looks like a real keyboard key</li>
</ul></li>
<li><code>mark</code>
<ul><li>Added padding</li>
<li>Color follows theme</li>
</ul></li>
<li><code>nav</code>
<ul><li>Added between-element margins</li>
</ul></li>
<li><code>samp</code>
<ul><li>Ambiguous element, merged with <code>code</code></li>
</ul></li>
<li><code>table</code>
<ul><li>Basic styling to make cells more discernable
<ul><li>Border stroke across all cells</li>
<li>Alternating row background color</li>
</ul></li>
</ul></li>
</ul></details><br/><h2 id="themes">Themes</h2>
<p>new.css uses an 10-color palette and can be easily customized. These are declared as CSS variables in the <code>:root</code> attribute.</p>
<blockquote readability="7">
<p>💡 Both <code>new.min.css</code> and <code>lite.css</code> have support for custom themes. <code>lite</code> doesn't import the font Inter by default, so it is recommended if you are using a custom font.</p>
</blockquote>
<h3 id="customizing">Customizing</h3>
<p>By loading a secondary style sheet after new.css in your HTML, you can override these variables. Here's the default theme:</p>
<details readability="22"><summary>Default theme</summary><pre>
@import url('https://fonts.xz.style/serve/inter.css');
:root {
--nc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont,
'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open
Sans', 'Helvetica Neue', sans-serif, "Apple Color
Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--nc-font-mono: 'Courier New', Courier, 'Ubuntu Mono',
'Liberation Mono', monospace;
--nc-tx-1: #000000;
--nc-tx-2: #1A1A1A;
--nc-bg-1: #FFFFFF;
--nc-bg-2: #F6F8FA;
--nc-bg-3: #E5E7EB;
--nc-lk-1: #0070F3;
--nc-lk-2: #0366D6;
--nc-lk-tx: #FFFFFF;
--nc-ac-1: #79FFE1;
--nc-ac-tx: #0C4047;
}</pre>
</details><h3 id="legend">Legend</h3>
<ul><li><code>--nc-font-sans</code>: Font for all text besides code or
preformatted</li>
<li><code>--nc-font-mono</code>: Font for <code><code></code>, <code><pre></code>,
<code><kbd></code>, <code><samp></code></li>
<li><code>--nc-tx-1</code>: Heading text color</li>
<li><code>--nc-tx-2</code>: Body text color</li>
<li><code>--nc-bg-1</code>: Base background color</li>
<li><code>--nc-bg-2</code>: Slightly darker background color</li>
<li><code>--nc-bg-3</code>: Even slightly darker background color</li>
<li><code>--nc-lk-1</code>: Action color for links and buttons</li>
<li><code>--nc-lk-2</code>: Link and buttons on mouse hover and active</li>
<li><code>--nc-ac-1</code>: Accent color for <code><mark></code> and
text selection background</li>
</ul><h3 id="usage">Usage</h3>
<ol readability="-0.48139158576052"><li>Create a stylesheet including some or all of the above variables in the <code>:root</code>. An example theme file is available here: <a href="https://newcss.net/theme/boilerplate.css" style="color: inherit; text-decoration: none;" name="readabilityLink-11">boilerplate.css</a><a href="#readabilityFootnoteLink-11" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[11]</sup></small></a></li>
<li>If you'd like to import custom fonts, put the <code>@import</code> tag before the <code>:root</code> element. Many open-source fonts are available on <a href="https://github.com/xz/fonts" style="color: inherit; text-decoration: none;" name="readabilityLink-12">xz/fonts</a><a href="#readabilityFootnoteLink-12" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[12]</sup></small></a>.</li>
<li readability="2">Reference your new stylesheet <strong>after</strong> new.css in your <code><head></code>. Here's an example <code><head></code>:
<pre>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://newcss.net/lite.css">
<link rel="stylesheet" href="https://example.com/MY-CUSTOM-THEME.css">
</head></pre>
</li>
</ol><br/><h2 id="pre-made-themes">Pre-Made Themes</h2>
<p>Here are two extra themes with CDN links. Feel free to use or edit them!</p>
<h3 id="night">Night</h3>
<p>Night theme is enabled by default if your browser is set to prefer dark themes. Using the theme link below makes it use night theme regardless.</p>
<code><link rel="stylesheet" href="https://newcss.net/theme/night.css"></code>
<p>Preview at <a href="https://newcss.net/theme/night/" style="color: inherit; text-decoration: none;" name="readabilityLink-13">newcss.net/theme/night/</a><a href="#readabilityFootnoteLink-13" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[13]</sup></small></a></p>
<p><img src="assets/night.png" alt="Night theme" width="400px"/></p>
<h3 id="terminal">Terminal</h3>
<code><link rel="stylesheet" href="https://newcss.net/theme/terminal.css"></code>
<p>Preview at <a href="https://newcss.net/theme/terminal/" style="color: inherit; text-decoration: none;" name="readabilityLink-14">newcss.net/theme/terminal/</a><a href="#readabilityFootnoteLink-14" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[14]</sup></small></a></p>
<p><img src="assets/terminal.png" alt="Terminal theme" width="400px"/></p>
<br/><h2>Sponsors</h2>
<h2 id="special-thanks">Special Thanks</h2>
<br/><hr/><p>We collect totally anonymous basic analytics using Simple Analytics. View live analytics at <a href="https://simpleanalytics.com/newcss.net" style="color: inherit; text-decoration: none;" name="readabilityLink-15">simpleanalytics.com/newcss.net</a><a href="#readabilityFootnoteLink-15" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[15]</sup></small></a>.</p>
<br/><hr/><p><a href="https://vercel.com?utmsource=xz&utmcampaign=new.css" target="blank"><img src="https://vercel-badges.now.sh/powered-by-vercel.svg" alt="Powered by Vercel"/></a></p>
<noscript><img src="https://api.newcss.net/noscript.gif" alt=""/></noscript>
</body></div><div id="readability-footnotes"><h3>References</h3><ol id="readability-footnotes-list"><li><small><sup><a href="#readabilityLink-1" title="Jump to Link in Article">^</a></sup></small> <a href="https://newcss.net" name="readabilityFootnoteLink-1">Home</a><small> (newcss.net)</small></li><li><small><sup><a href="#readabilityLink-2" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/xz/new.css" name="readabilityFootnoteLink-2">GitHub</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-3" title="Jump to Link in Article">^</a></sup></small> <a href="https://discord.gg/hhuuC4w" name="readabilityFootnoteLink-3">Discord</a><small> (discord.gg)</small></li><li><small><sup><a href="#readabilityLink-4" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/xz/new.css/blob/master/index.html" name="readabilityFootnoteLink-4">View Source</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-5" title="Jump to Link in Article">^</a></sup></small> <a href="https://newcss.net/demo/" name="readabilityFootnoteLink-5">here</a><small> (newcss.net)</small></li><li><small><sup><a href="#readabilityLink-6" title="Jump to Link in Article">^</a></sup></small> <a href="https://newcss.net/quickstart/" name="readabilityFootnoteLink-6">here</a><small> (newcss.net)</small></li><li><small><sup><a href="#readabilityLink-7" title="Jump to Link in Article">^</a></sup></small> <a href="https://vercel.com?utmsource=xz&utmcampaign=new.css" name="readabilityFootnoteLink-7">Vercel</a><small> (vercel.com)</small></li><li><small><sup><a href="#readabilityLink-8" title="Jump to Link in Article">^</a></sup></small> <a href="https://rsms.me/inter" name="readabilityFootnoteLink-8">Inter</a><small> (rsms.me)</small></li><li><small><sup><a href="#readabilityLink-9" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/xz/fonts" name="readabilityFootnoteLink-9">xz/fonts</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-10" title="Jump to Link in Article">^</a></sup></small> <a href="https://newcss.net/theme/terminal/" name="readabilityFootnoteLink-10">newcss.net/theme/terminal/</a><small> (newcss.net)</small></li><li><small><sup><a href="#readabilityLink-11" title="Jump to Link in Article">^</a></sup></small> <a href="https://newcss.net/theme/boilerplate.css" name="readabilityFootnoteLink-11">boilerplate.css</a><small> (newcss.net)</small></li><li><small><sup><a href="#readabilityLink-12" title="Jump to Link in Article">^</a></sup></small> <a href="https://github.com/xz/fonts" name="readabilityFootnoteLink-12">xz/fonts</a><small> (github.com)</small></li><li><small><sup><a href="#readabilityLink-13" title="Jump to Link in Article">^</a></sup></small> <a href="https://newcss.net/theme/night/" name="readabilityFootnoteLink-13">newcss.net/theme/night/</a><small> (newcss.net)</small></li><li><small><sup><a href="#readabilityLink-14" title="Jump to Link in Article">^</a></sup></small> <a href="https://newcss.net/theme/terminal/" name="readabilityFootnoteLink-14">newcss.net/theme/terminal/</a><small> (newcss.net)</small></li><li><small><sup><a href="#readabilityLink-15" title="Jump to Link in Article">^</a></sup></small> <a href="https://simpleanalytics.com/newcss.net" name="readabilityFootnoteLink-15">simpleanalytics.com/newcss.net</a><small> (simpleanalytics.com)</small></li></ol></div>