···34343535## what exactly does it change?
36363737-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
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
4040+4. increases line height and changes tab size
4141+5. opt-in styles for elements in containers with `prose` class:
4242+ 1. sets 100% maximum width for images, videos, and iframes
4343+ 2. adds a background to inline code and code blocks for better readability
4444+ 3. adds borders and padding to table elements for better spacing and clarity
4545+ 4. makes blockquotes look a bit nicer with a border and padding
4646+4747+keep in mind that this is not a CSS reset or normalization stylesheet. it simply adds some better defaults with the aim of being as minimal as possible. if you need a normalization stylesheet, i recommend using [modern-normalize](https://github.com/sindresorhus/modern-normalize).
4848+4949+## prose elements
45504646-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).
5151+slight.css offers built-in styles to beautify certain elements, such as blockquotes, tables, code, pre, and more. these styles are **opt-in**, and to use them, you have to apply the `prose` class to a container that wraps your content, such as a `body`, `main`, or `div`. you can see the demo's [index.html](https://github.com/intergrav/slight.css/blob/main/index.html) for an example of it's usage.
47524853## can i see what it looks like?
4954···51565257## difference between this and dev.css?
53585454-i maintain and use both, but this is a much more simple alternative to [dev.css](https://devcss.devins.page) 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.
5959+i maintain and use both, but this is a much more simple alternative to [dev.css](https://devcss.devins.page) that mainly focuses on improving default user agent stylesheets rather than having a full custom set of styles. it doesn't have custom theme support (although you can apply your own stylesheets on top). it may also be less consistent across browsers. another difference is that dev.css is classless, while slight.css contains a `prose` class.
+146-143
index.html
···2020 <header>
2121 <h1>slight.css</h1>
2222 <nav>
2323- <ul>
2424- <li>
2525- <a href="https://npmjs.com/package/@intergrav/slight.css">npm</a>
2626- </li>
2727- <li>
2828- <a href="https://github.com/intergrav/slight.css">git</a>
2929- </li>
3030- <li>
3131- <a href="https://github.com/intergrav/slight.css/issues">issues</a>
3232- </li>
3333- </ul>
2323+ <a href="https://npmjs.com/package/@intergrav/slight.css">npm</a> /
2424+ <a href="https://github.com/intergrav/slight.css">git</a> /
2525+ <a href="https://github.com/intergrav/slight.css/issues">issues</a>
3426 </nav>
3527 </header>
3636- <p>
3737- <strong>slight.css</strong> is an incredibly simple CSS stylesheet that
3838- adds some <em>slight</em> enhancements on top of the default user agent
3939- stylesheet.
4040- </p>
4141- <p>
4242- it aims to provide a more pleasant reading experience while relying mostly
4343- on native browser styles. things such as background and text colors are
4444- chosen by the browser.
4545- </p>
4646- <p>
4747- this can be used as a good baseline for any web project, or as-is for a
4848- super barebones website.
4949- </p>
5050- <p>
5151- the page that you are currently viewing is using slight.css as its
5252- stylesheet.
5353- </p>
5454- <h2>how do i use it?</h2>
5555- <h3>html import</h3>
5656- <p>place this somewhere in your <code>head</code>:</p>
5757- <pre><code><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1"></code></pre>
5858- <h3>css import</h3>
5959- <p>place this somewhere in your stylesheet:</p>
6060- <pre><code>@import url(https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1);</code></pre>
6161- <h3>npm package</h3>
6262- <p>
6363- run this in your terminal,
6464- <strong>replacing with the proper command</strong>:
6565- </p>
6666- <pre><code>[npm/yarn/pnpm/bun] add @intergrav/slight.css</code></pre>
6767- <h2>what exactly does it change?</h2>
6868- <ol>
6969- <li>
7070- automatically adjusts the color scheme based on system preferences
7171- </li>
7272- <li>uses the default system sans-serif/monospace fonts</li>
7373- <li>sets a maximum width for the body content on widescreen viewports</li>
7474- <li>increases line height and changes tab size</li>
7575- <li>
7676- adds borders and padding to table elements for better spacing and
7777- clarity
7878- </li>
7979- <li>
8080- adds a border to inline code and code blocks for better readability
8181- </li>
8282- <li>makes blockquotes look a bit nicer with a border and padding</li>
8383- <li>displays lists in nav horizontally when placed in header</li>
8484- </ol>
8585- <p>
8686- keep in mind that this is not a CSS reset or normalization stylesheet. it
8787- simply adds some better defaults with the aim of being as minimal as
8888- possible. if you need a normalization stylesheet, i recommend using
8989- <a href="https://github.com/sindresorhus/modern-normalize"
9090- >modern-normalize</a
9191- >.
9292- </p>
9393- <h2>demo elements</h2>
9494- <h3>blockquote</h3>
9595- <blockquote cite="https://example.com">
2828+ <main class="prose">
2929+ <p>
3030+ <strong>slight.css</strong> is an incredibly simple CSS stylesheet that
3131+ adds some <em>slight</em> enhancements on top of the default user agent
3232+ stylesheet.
3333+ </p>
3434+ <p>
3535+ it aims to provide a more pleasant reading experience while relying
3636+ mostly on native browser styles. things such as background and text
3737+ colors are chosen by the browser.
3838+ </p>
3939+ <p>
4040+ this can be used as a good baseline for any web project, or as-is for a
4141+ super barebones website.
4242+ </p>
4343+ <p>
4444+ the page that you are currently viewing is using slight.css as its
4545+ stylesheet.
4646+ </p>
4747+ <h2>how do i use it?</h2>
4848+ <h3>html import</h3>
4949+ <p>place this somewhere in your <code>head</code>:</p>
5050+ <pre><code><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1"></code></pre>
5151+ <h3>css import</h3>
5252+ <p>place this somewhere in your stylesheet:</p>
5353+ <pre><code>@import url(https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1);</code></pre>
5454+ <h3>npm package</h3>
5555+ <p>
5656+ run this in your terminal,
5757+ <strong>replacing with the proper command</strong>:
5858+ </p>
5959+ <pre><code>[npm/yarn/pnpm/bun] add @intergrav/slight.css</code></pre>
6060+ <h2>what exactly does it change?</h2>
6161+ <ol>
6262+ <li>
6363+ automatically adjusts the color scheme based on system preferences
6464+ </li>
6565+ <li>uses the default system sans-serif/monospace fonts</li>
6666+ <li>
6767+ sets a maximum width for the body content on widescreen viewports
6868+ </li>
6969+ <li>increases line height and changes tab size</li>
7070+ <li>
7171+ opt-in styles for elements in containers with
7272+ <code>prose</code> class:
7373+ <ol>
7474+ <li>sets 100% maximum width for images, videos, and iframes</li>
7575+ <li>
7676+ adds a background to inline code and code blocks for better
7777+ readability
7878+ </li>
7979+ <li>
8080+ adds borders and padding to table elements for better spacing and
8181+ clarity
8282+ </li>
8383+ <li>
8484+ makes blockquotes look a bit nicer with a border and padding
8585+ </li>
8686+ </ol>
8787+ </li>
8888+ </ol>
9689 <p>
9797- congue ex inceptos ut est gravida purus. convallis suspendisse mattis
9898- porta metus mus nisl ad ante eros inceptos. iaculis convallis gravida
9999- odio venenatis ut velit. fames non nunc sollicitudin dictumst litora
100100- natoque consectetur erat. fermentum mattis arcu quam sociosqu libero
101101- tincidunt pellentesque rutrum. pulvinar per habitasse fusce nec bibendum
102102- tempor natoque efficitur si.
9090+ keep in mind that this is not a CSS reset or normalization stylesheet.
9191+ it simply adds some better defaults with the aim of being as minimal as
9292+ possible. if you need a normalization stylesheet, i recommend using
9393+ <a href="https://github.com/sindresorhus/modern-normalize"
9494+ >modern-normalize</a
9595+ >.
9696+ </p>
9797+ <h2>prose elements</h2>
9898+ <p>
9999+ slight.css offers built-in styles to beautify certain elements, such as
100100+ blockquotes, tables, code, pre, and more. these styles are
101101+ <strong>opt-in</strong>, and to use them, you have to apply the
102102+ <code>prose</code> class to a container that wraps your content, such as
103103+ a <code>body</code>, <code>main</code>, or <code>div</code>. you can see
104104+ the demo's
105105+ <a href="https://github.com/intergrav/slight.css/blob/main/index.html"
106106+ >index.html</a
107107+ >
108108+ for an example of it's usage.
103109 </p>
104104- <footer>— <cite>a really cool person</cite></footer>
105105- </blockquote>
106106- <blockquote>
107107- <p>this is a blockquote without a citation.</p>
110110+ <h3>blockquote</h3>
111111+ <blockquote cite="https://example.com">
112112+ <p>
113113+ congue ex inceptos ut est gravida purus. convallis suspendisse mattis
114114+ porta metus mus nisl ad ante eros inceptos. iaculis convallis gravida
115115+ odio venenatis ut velit. fames non nunc sollicitudin dictumst litora
116116+ natoque consectetur erat. fermentum mattis arcu quam sociosqu libero
117117+ tincidunt pellentesque rutrum. pulvinar per habitasse fusce nec
118118+ bibendum tempor natoque efficitur si.
119119+ </p>
120120+ <footer>— <cite>a really cool person</cite></footer>
121121+ </blockquote>
108122 <blockquote>
109109- <p>this is a nested blockquote.</p>
123123+ <p>this is a blockquote without a citation.</p>
124124+ <blockquote>
125125+ <p>this is a nested blockquote.</p>
126126+ </blockquote>
110127 </blockquote>
111111- </blockquote>
112112- <h3>table</h3>
113113- <table>
114114- <caption>
115115- table caption
116116- </caption>
117117- <thead>
118118- <tr>
119119- <th>header 1</th>
120120- <th>header 2</th>
121121- <th>header 3</th>
122122- </tr>
123123- </thead>
124124- <tbody>
125125- <tr>
126126- <td>row 1</td>
127127- <td>row 1</td>
128128- <td>row 1</td>
129129- </tr>
130130- <tr>
131131- <td>row 2</td>
132132- <td>row 2</td>
133133- <td>row 2</td>
134134- </tr>
135135- </tbody>
136136- </table>
137137- <h3>code</h3>
138138- <p>
139139- this is normal text, while this is <code>inline code</code> marked with
140140- code tag.
141141- </p>
142142- <h3>code block (pre+code)</h3>
143143- <pre><code>this is a code block
128128+ <h3>table</h3>
129129+ <table>
130130+ <caption>
131131+ table caption
132132+ </caption>
133133+ <thead>
134134+ <tr>
135135+ <th>header 1</th>
136136+ <th>header 2</th>
137137+ <th>header 3</th>
138138+ </tr>
139139+ </thead>
140140+ <tbody>
141141+ <tr>
142142+ <td>row 1</td>
143143+ <td>row 1</td>
144144+ <td>row 1</td>
145145+ </tr>
146146+ <tr>
147147+ <td>row 2</td>
148148+ <td>row 2</td>
149149+ <td>row 2</td>
150150+ </tr>
151151+ </tbody>
152152+ </table>
153153+ <h3>code</h3>
154154+ <p>
155155+ this is normal text, while this is <code>inline code</code> marked with
156156+ code tag.
157157+ </p>
158158+ <h3>code block (pre+code)</h3>
159159+ <pre><code>this is a code block
144160 this is a line of code, indented with tab
145161 this is another line of code, indented with tab
146162beep boop</code></pre>
147147- <h3>forms</h3>
148148- <p>this form doesn't actually do anything its just a demo</p>
149149- <form>
150150- <label for="fname">first name</label><br />
151151- <input type="text" id="fname" name="fname" /><br />
152152- <label for="lname">last name</label><br />
153153- <input type="text" id="lname" name="lname" /><br /><br />
154154- <input type="radio" id="one" name="options" value="option 1" />
155155- <label for="one">option 1</label><br />
156156- <input type="radio" id="two" name="options" value="option 2" />
157157- <label for="two">option 2</label><br />
158158- <input type="radio" id="three" name="options" value="option 3" />
159159- <label for="three">option 3</label><br /><br />
160160- <input type="submit" value="submit" />
161161- </form>
162162- <h2>difference between this and dev.css?</h2>
163163- <p>
164164- i maintain and use both, but this is a much more simple alternative to
165165- <a href="https://devcss.devins.page">dev.css</a> that mainly focuses on
166166- improving default user agent stylesheets rather than having a full custom
167167- set of styles. slight.css is more limited as it has less built-in element
168168- styles and doesn't have custom theme support (although you can apply your
169169- own stylesheets on top). it may also be less consistent across browsers.
170170- </p>
171171- <a href="https://devins.page"
172172- ><img
173173- src="https://raw.githubusercontent.com/intergrav/branding/refs/heads/main/personal/badge.svg"
174174- /></a>
163163+ <h2>difference between this and dev.css?</h2>
164164+ <p>
165165+ i maintain and use both, but this is a much more simple alternative to
166166+ <a href="https://devcss.devins.page">dev.css</a> that mainly focuses on
167167+ improving default user agent stylesheets rather than having a full
168168+ custom set of styles. it doesn't have custom theme support (although you
169169+ can apply your own stylesheets on top). it may also be less consistent
170170+ across browsers. another difference is that dev.css is classless, while
171171+ slight.css contains a <code>prose</code> class.
172172+ </p>
173173+ <a href="https://devins.page"
174174+ ><img
175175+ src="https://raw.githubusercontent.com/intergrav/branding/refs/heads/main/personal/badge.svg"
176176+ /></a>
177177+ </main>
175178 <footer>
176179 <p>
177180 slight.css and this website was written by