···11+# slight.css
22+33+**slight.css** is an incredibly simple CSS stylesheet that adds some _slight_ enhancements on top of the default user agent stylesheet.
44+55+it aims to provide a more pleasant reading experience while relying mostly on native browser styles. things such as background and text colors are chosen by the browser.
66+77+this can be used as a good baseline for any web project, or as-is for a super barebones website/blog.
88+99+## how do i use it?
1010+1111+### html import
1212+1313+place this somewhere in your `<head>`:
1414+1515+```
1616+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1">
1717+```
1818+1919+### css import
2020+2121+place this somewhere in your stylesheet:
2222+2323+```
2424+@import url(https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1);
2525+```
2626+2727+### npm package
2828+2929+run this in your terminal, **replace with the proper command**:
3030+3131+```
3232+[npm/yarn/pnpm/bun] add @intergrav/slight.css
3333+```
3434+3535+## what exactly does it change?
3636+3737+1. automatically adjusts the color scheme based on system preferences
3838+2. uses the default system sans-serif/monospace fonts
3939+3. sets a maximum width for the body content on widescreen viewports (reverted when printing)
4040+4. increases line height and changes tab size
4141+5. adds borders and padding to table elements for better spacing and clarity
4242+6. adds a border to inline code and code blocks for better readability
4343+7. makes blockquotes look a bit nicer with a border and padding
4444+8. displays lists in nav horizontally when placed in header
4545+4646+keep in mind that mostly relying on the user agent stylesheet means that things could possibly look different on other browsers. for certain projects, this may matter, and you might want to look into using a CSS reset/normalize stylesheet such as [modern-normalize](https://github.com/sindresorhus/modern-normalize).
4747+4848+## can i see what it looks like?
4949+5050+yes! there is a demo available at [slightcss.devins.page](https://slightcss.devins.page). keep in mind that it may look different depending on the browser you use.
5151+5252+## difference between this and dev.css?
5353+5454+i maintain and use both, but this is a much more simple alternative to dev.css that mainly focuses on improving default user agent stylesheets rather than having a full custom set of styles. slight.css is more limited as it has less built-in element styles and doesn't have custom theme support (although you can apply your own stylesheets on top). it may also be less consistent across browsers.
+146
demo.html
···11+<!DOCTYPE html>
22+<html lang="en">
33+ <head>
44+ <meta charset="UTF-8" />
55+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
66+ <title>slight.css</title>
77+ <link rel="stylesheet" href="slight.css" />
88+ </head>
99+ <body>
1010+ <header>
1111+ <h1>slight.css</h1>
1212+ <nav>
1313+ <ul>
1414+ <li>
1515+ <a href="https://npmjs.com/package/@intergrav/slight.css">npm</a>
1616+ </li>
1717+ <li>
1818+ <a href="https://github.com/intergrav/slight.css">git</a>
1919+ </li>
2020+ <li>
2121+ <a href="https://github.com/intergrav/slight.css/issues">issues</a>
2222+ </li>
2323+ </ul>
2424+ </nav>
2525+ </header>
2626+ <p>
2727+ <strong>slight.css</strong> is an incredibly simple CSS stylesheet that
2828+ adds some <em>slight</em> enhancements on top of the default user agent
2929+ stylesheet.
3030+ </p>
3131+ <p>
3232+ it aims to provide a more pleasant reading experience while relying mostly
3333+ on native browser styles. things such as background and text colors are
3434+ chosen by the browser.
3535+ </p>
3636+ <p>
3737+ this can be used as a good baseline for any web project, or as-is for a
3838+ super barebones website.
3939+ </p>
4040+ <p>
4141+ the page that you are currently viewing is using slight.css as its
4242+ stylesheet.
4343+ </p>
4444+ <h2>how do i use it?</h2>
4545+ <h3>html import</h3>
4646+ <p>Place this somewhere in your <code>head</code>:</p>
4747+ <pre><code><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1"></code></pre>
4848+ <h3>css import</h3>
4949+ <p>Place this somewhere in your stylesheet:</p>
5050+ <pre><code>@import url(https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1);</code></pre>
5151+ <h3>npm package</h3>
5252+ <p>
5353+ Run this in your terminal,
5454+ <strong>replacing with the proper command</strong>:
5555+ </p>
5656+ <pre><code>[npm/yarn/pnpm/bun] add @intergrav/slight.css</code></pre>
5757+ <h2>what exactly does it change?</h2>
5858+ <ol>
5959+ <li>
6060+ automatically adjusts the color scheme based on system preferences
6161+ </li>
6262+ <li>uses the default system sans-serif/monospace fonts</li>
6363+ <li>sets a maximum width for the body content on widescreen viewports</li>
6464+ <li>increases line height and changes tab size</li>
6565+ <li>
6666+ adds borders and padding to table elements for better spacing and
6767+ clarity
6868+ </li>
6969+ <li>
7070+ adds a border to inline code and code blocks for better readability
7171+ </li>
7272+ <li>makes blockquotes look a bit nicer with a border and padding</li>
7373+ <li>displays lists in nav horizontally when placed in header</li>
7474+ </ol>
7575+ <p>
7676+ keep in mind that mostly relying on the user agent stylesheet means that
7777+ things could possibly look different on other browsers. for certain
7878+ projects, this may matter, and you might want to look into using a CSS
7979+ reset/normalize stylesheet such as
8080+ <a href="https://github.com/sindresorhus/modern-normalize"
8181+ >modern-normalize</a
8282+ >.
8383+ </p>
8484+ <h2>demo elements</h2>
8585+ <h3>blockquote</h3>
8686+ <blockquote cite="https://example.com">
8787+ <p>
8888+ congue ex inceptos ut est gravida purus. convallis suspendisse mattis
8989+ porta metus mus nisl ad ante eros inceptos. iaculis convallis gravida
9090+ odio venenatis ut velit. fames non nunc sollicitudin dictumst litora
9191+ natoque consectetur erat. fermentum mattis arcu quam sociosqu libero
9292+ tincidunt pellentesque rutrum. pulvinar per habitasse fusce nec bibendum
9393+ tempor natoque efficitur si.
9494+ </p>
9595+ <footer>— <cite>a really cool person</cite></footer>
9696+ </blockquote>
9797+ <h3>table</h3>
9898+ <table>
9999+ <caption>
100100+ table caption
101101+ </caption>
102102+ <thead>
103103+ <tr>
104104+ <th>header 1</th>
105105+ <th>header 2</th>
106106+ <th>header 3</th>
107107+ </tr>
108108+ </thead>
109109+ <tbody>
110110+ <tr>
111111+ <td>row 1</td>
112112+ <td>row 1</td>
113113+ <td>row 1</td>
114114+ </tr>
115115+ <tr>
116116+ <td>row 2</td>
117117+ <td>row 2</td>
118118+ <td>row 2</td>
119119+ </tr>
120120+ </tbody>
121121+ </table>
122122+ <h3>code</h3>
123123+ <p>
124124+ this is normal text, while this is <code>inline code</code> marked with
125125+ code tag.
126126+ </p>
127127+ <h3>code block (pre+code)</h3>
128128+ <pre><code>this is a code block
129129+ this is a line of code, indented with tab
130130+ this is another line of code, indented with tab
131131+beep boop</code></pre>
132132+ <h2>difference between this and dev.css?</h2>
133133+ <p>
134134+ i maintain and use both, but this is a much more simple alternative to
135135+ dev.css that mainly focuses on improving default user agent stylesheets
136136+ rather than having a full custom set of styles. slight.css is more limited
137137+ as it has less built-in element styles and doesn't have custom theme
138138+ support (although you can apply your own stylesheets on top). it may also
139139+ be less consistent across browsers.
140140+ </p>
141141+ <a href="https://devins.page"
142142+ ><img
143143+ src="https://raw.githubusercontent.com/intergrav/branding/refs/heads/main/personal/badge.svg"
144144+ /></a>
145145+ </body>
146146+</html>