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 4c8eae7c5eb5f901b706d5f92b79d102da1b7204 146 lines 4.7 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 <link rel="stylesheet" href="slight.css" /> 8 </head> 9 <body> 10 <header> 11 <h1>slight.css</h1> 12 <nav> 13 <ul> 14 <li> 15 <a href="https://npmjs.com/package/@intergrav/slight.css">npm</a> 16 </li> 17 <li> 18 <a href="https://github.com/intergrav/slight.css">git</a> 19 </li> 20 <li> 21 <a href="https://github.com/intergrav/slight.css/issues">issues</a> 22 </li> 23 </ul> 24 </nav> 25 </header> 26 <p> 27 <strong>slight.css</strong> is an incredibly simple CSS stylesheet that 28 adds some <em>slight</em> enhancements on top of the default user agent 29 stylesheet. 30 </p> 31 <p> 32 it aims to provide a more pleasant reading experience while relying mostly 33 on native browser styles. things such as background and text colors are 34 chosen by the browser. 35 </p> 36 <p> 37 this can be used as a good baseline for any web project, or as-is for a 38 super barebones website. 39 </p> 40 <p> 41 the page that you are currently viewing is using slight.css as its 42 stylesheet. 43 </p> 44 <h2>how do i use it?</h2> 45 <h3>html import</h3> 46 <p>place this somewhere in your <code>head</code>:</p> 47 <pre><code>&lt;link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1"&gt;</code></pre> 48 <h3>css import</h3> 49 <p>place this somewhere in your stylesheet:</p> 50 <pre><code>@import url(https://cdn.jsdelivr.net/npm/@intergrav/slight.css@1);</code></pre> 51 <h3>npm package</h3> 52 <p> 53 run this in your terminal, 54 <strong>replacing with the proper command</strong>: 55 </p> 56 <pre><code>[npm/yarn/pnpm/bun] add @intergrav/slight.css</code></pre> 57 <h2>what exactly does it change?</h2> 58 <ol> 59 <li> 60 automatically adjusts the color scheme based on system preferences 61 </li> 62 <li>uses the default system sans-serif/monospace fonts</li> 63 <li>sets a maximum width for the body content on widescreen viewports</li> 64 <li>increases line height and changes tab size</li> 65 <li> 66 adds borders and padding to table elements for better spacing and 67 clarity 68 </li> 69 <li> 70 adds a border to inline code and code blocks for better readability 71 </li> 72 <li>makes blockquotes look a bit nicer with a border and padding</li> 73 <li>displays lists in nav horizontally when placed in header</li> 74 </ol> 75 <p> 76 keep in mind that mostly relying on the user agent stylesheet means that 77 things could possibly look different on other browsers. for certain 78 projects, this may matter, and you might want to look into using a CSS 79 reset/normalize stylesheet such as 80 <a href="https://github.com/sindresorhus/modern-normalize" 81 >modern-normalize</a 82 >. 83 </p> 84 <h2>demo elements</h2> 85 <h3>blockquote</h3> 86 <blockquote cite="https://example.com"> 87 <p> 88 congue ex inceptos ut est gravida purus. convallis suspendisse mattis 89 porta metus mus nisl ad ante eros inceptos. iaculis convallis gravida 90 odio venenatis ut velit. fames non nunc sollicitudin dictumst litora 91 natoque consectetur erat. fermentum mattis arcu quam sociosqu libero 92 tincidunt pellentesque rutrum. pulvinar per habitasse fusce nec bibendum 93 tempor natoque efficitur si. 94 </p> 95 <footer><cite>a really cool person</cite></footer> 96 </blockquote> 97 <h3>table</h3> 98 <table> 99 <caption> 100 table caption 101 </caption> 102 <thead> 103 <tr> 104 <th>header 1</th> 105 <th>header 2</th> 106 <th>header 3</th> 107 </tr> 108 </thead> 109 <tbody> 110 <tr> 111 <td>row 1</td> 112 <td>row 1</td> 113 <td>row 1</td> 114 </tr> 115 <tr> 116 <td>row 2</td> 117 <td>row 2</td> 118 <td>row 2</td> 119 </tr> 120 </tbody> 121 </table> 122 <h3>code</h3> 123 <p> 124 this is normal text, while this is <code>inline code</code> marked with 125 code tag. 126 </p> 127 <h3>code block (pre+code)</h3> 128 <pre><code>this is a code block 129 this is a line of code, indented with tab 130 this is another line of code, indented with tab 131beep boop</code></pre> 132 <h2>difference between this and dev.css?</h2> 133 <p> 134 i maintain and use both, but this is a much more simple alternative to 135 dev.css that mainly focuses on improving default user agent stylesheets 136 rather than having a full custom set of styles. slight.css is more limited 137 as it has less built-in element styles and doesn't have custom theme 138 support (although you can apply your own stylesheets on top). it may also 139 be less consistent across browsers. 140 </p> 141 <a href="https://devins.page" 142 ><img 143 src="https://raw.githubusercontent.com/intergrav/branding/refs/heads/main/personal/badge.svg" 144 /></a> 145 </body> 146</html>