slight enhancements for the user agent stylesheet slightcss.devins.page
css stylesheet framework lightweight
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 34fb5d1a952116f79da969a2fae077117fcc97d9 185 lines 6.1 kB view raw
1<!doctype html> 2<html lang="en"> 3 <head> 4 <meta charset="UTF-8" /> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 <title>slight.css</title> 7 <meta 8 name="description" 9 content="slight enhancements for the user agent stylesheet" 10 /> 11 <meta 12 name="keywords" 13 content="css, stylesheet, framework, classless, minimal, lightweight, open-source" 14 /> 15 <meta name="author" content="intergrav" /> 16 <meta name="robots" content="index, follow" /> 17 <link rel="stylesheet" href="slight.css" /> 18 </head> 19 <body> 20 <header> 21 <h1>slight.css</h1> 22 <nav> 23 <a href="https://npmjs.com/package/@intergrav/slight.css">npm</a> / 24 <a href="https://github.com/intergrav/slight.css">git</a> / 25 <a href="https://github.com/intergrav/slight.css/issues">issues</a> 26 </nav> 27 </header> 28 <main class="prose"> 29 <p> 30 <strong>slight.css</strong> is an incredibly simple CSS stylesheet that 31 adds some <em>slight</em> enhancements on top of the default user agent 32 stylesheet. 33 </p> 34 <p> 35 it aims to provide a more pleasant reading experience while relying 36 mostly on native browser styles. things such as background and text 37 colors are chosen by the browser. 38 </p> 39 <p> 40 this can be used as a good baseline for any web project, or as-is for a 41 super barebones website. 42 </p> 43 <p> 44 the page that you are currently viewing is using slight.css as its 45 stylesheet. 46 </p> 47 <h2>how do i use it?</h2> 48 <h3>html import</h3> 49 <p>place this somewhere in your <code>head</code>:</p> 50 <pre><code>&lt;link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1"&gt;</code></pre> 51 <h3>css import</h3> 52 <p>place this somewhere in your stylesheet:</p> 53 <pre><code>@import url(https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1);</code></pre> 54 <h3>npm package</h3> 55 <p> 56 run this in your terminal, 57 <strong>replacing with the proper command</strong>: 58 </p> 59 <pre><code>[npm/yarn/pnpm/bun] add @intergrav/slight.css</code></pre> 60 <h2>what exactly does it change?</h2> 61 <ol> 62 <li> 63 automatically adjusts the color scheme based on system preferences 64 </li> 65 <li>uses the default system sans-serif/monospace fonts</li> 66 <li> 67 sets a maximum width for the body content on widescreen viewports 68 </li> 69 <li>increases line height and changes tab size</li> 70 <li> 71 opt-in styles for elements in containers with 72 <code>prose</code> class: 73 <ol> 74 <li>sets 100% maximum width for images, videos, and iframes</li> 75 <li> 76 adds a background to inline code and code blocks for better 77 readability 78 </li> 79 <li> 80 adds borders and padding to table elements for better spacing and 81 clarity 82 </li> 83 <li> 84 makes blockquotes look a bit nicer with a border and padding 85 </li> 86 </ol> 87 </li> 88 </ol> 89 <p> 90 keep in mind that this is not a CSS reset or normalization stylesheet. 91 it simply adds some better defaults with the aim of being as minimal as 92 possible. if you need a normalization stylesheet, i recommend using 93 <a href="https://github.com/sindresorhus/modern-normalize" 94 >modern-normalize</a 95 >. 96 </p> 97 <h2>prose elements</h2> 98 <p> 99 slight.css offers built-in styles to beautify certain elements, such as 100 blockquotes, tables, code, pre, and more. these styles are 101 <strong>opt-in</strong>, and to use them, you have to apply the 102 <code>prose</code> class to a container that wraps your content, such as 103 a <code>body</code>, <code>main</code>, or <code>div</code>. you can see 104 the demo's 105 <a href="https://github.com/intergrav/slight.css/blob/main/index.html" 106 >index.html</a 107 > 108 for an example of it's usage. 109 </p> 110 <h3>blockquote</h3> 111 <blockquote cite="https://example.com"> 112 <p> 113 congue ex inceptos ut est gravida purus. convallis suspendisse mattis 114 porta metus mus nisl ad ante eros inceptos. iaculis convallis gravida 115 odio venenatis ut velit. fames non nunc sollicitudin dictumst litora 116 natoque consectetur erat. fermentum mattis arcu quam sociosqu libero 117 tincidunt pellentesque rutrum. pulvinar per habitasse fusce nec 118 bibendum tempor natoque efficitur si. 119 </p> 120 <footer><cite>a really cool person</cite></footer> 121 </blockquote> 122 <blockquote> 123 <p>this is a blockquote without a citation.</p> 124 <blockquote> 125 <p>this is a nested blockquote.</p> 126 </blockquote> 127 </blockquote> 128 <h3>table</h3> 129 <table> 130 <caption> 131 table caption 132 </caption> 133 <thead> 134 <tr> 135 <th>header 1</th> 136 <th>header 2</th> 137 <th>header 3</th> 138 </tr> 139 </thead> 140 <tbody> 141 <tr> 142 <td>row 1</td> 143 <td>row 1</td> 144 <td>row 1</td> 145 </tr> 146 <tr> 147 <td>row 2</td> 148 <td>row 2</td> 149 <td>row 2</td> 150 </tr> 151 </tbody> 152 </table> 153 <h3>code</h3> 154 <p> 155 this is normal text, while this is <code>inline code</code> marked with 156 code tag. 157 </p> 158 <h3>code block (pre+code)</h3> 159 <pre><code>this is a code block 160 this is a line of code, indented with tab 161 this is another line of code, indented with tab 162beep boop</code></pre> 163 <h2>difference between this and dev.css?</h2> 164 <p> 165 i maintain and use both, but this is a much more simple alternative to 166 <a href="https://devcss.devins.page">dev.css</a> that mainly focuses on 167 improving default user agent stylesheets rather than having a full 168 custom set of styles. it doesn't have custom theme support (although you 169 can apply your own stylesheets on top). it may also be less consistent 170 across browsers. another difference is that dev.css is classless, while 171 slight.css contains a <code>prose</code> class. 172 </p> 173 <a href="https://devins.page" 174 ><img 175 src="https://raw.githubusercontent.com/intergrav/branding/refs/heads/main/personal/badge.svg" 176 /></a> 177 </main> 178 <footer> 179 <p> 180 slight.css and this website was written by 181 <a href="https://devins.page">intergrav</a> 182 </p> 183 </footer> 184 </body> 185</html>