lightweight, simple, classless CSS framework inspired by new.css devcss.devins.page
framework lightweight css classless stylesheet
17
fork

Configure Feed

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

1# intergrav/dev.css 2 3[![NPM Version](https://img.shields.io/npm/v/@intergrav/dev.css)](https://www.npmjs.com/package/@intergrav/dev.css) [![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/@intergrav/dev.css)](https://cdn.jsdelivr.net/npm/@intergrav/dev.css/) [![GitHub Repo stars](https://img.shields.io/github/stars/intergrav/dev.css)](https://github.com/intergrav/dev.css) 4 5Extremely simple, small, classless CSS framework in the style of Vercel's Geist. Inspired by [xz/new.css](https://github.com/xz/new.css). 6 7The minified stylesheet weighs only **~4.8kb** and can make any plain HTML file look clean and modern. 8 9It has a light and dark theme, and the header turns into a sidebar on wider displays so that you get more vertical space. 10 11## Importing 12 13In your HTML's `<head>` all you have to write is this, and you're done! (`.min` means to minify the file) 14 15```html 16<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/dev.css@2"> 17``` 18 19I also recommend adding a font through [intergrav/fonts](https://github.com/intergrav/fonts). Geist or Inter work with dev.css out of the box. It will use the default system/browser san-serif fonts otherwise. 20 21### Geist Font 22 23```html 24<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/fonts@1/serve/geist.min.css"> 25``` 26```html 27<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/fonts@1/serve/geist-mono.min.css"> 28``` 29 30### Inter Font 31 32```html 33<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/fonts@1/serve/inter.min.css"> 34``` 35 36## Elements 37 38dev.css takes advantage of semantic HTML elements. Here are some guidelines on how these should be used for the best results. 39 40### Header 41 42Use the `<header>` tag to create a large header for your page. Only use this at the very top of your `<body>`, or else it may look wonky. 43 44For the title, the header should contain an `<h1>` tag. You can also add an `<h4>` tag before the `<h1>` tag if you want to show extra information. 45 46If you need a navigation bar, you can add a `<nav>` with `<a>` links inside it. dev.css will automatically add dividing bullet points between or before the `<a>` tags, depending on whether the user is in topbar or sidebar mode. In sidebar mode, the navigation bar will lay out into separate lines. 47 48Optionally, you could add a `<p>` tag after the `<h1>` tag if you want to give a description of the page the user is currently on. 49 50### Text 51 52Wrap all body text in `<p>` tags, unless it's the sole child of another element. If you want to write quotes, you can use the `<blockquote>` tag. To highlight text, wrap it in the `<mark>` tag. Want to show code? Use `<code>` for short inline code. Use `<pre>` for code blocks. Use `<kbd>` for keyboard input. 53 54### Button 55 56For a link button, you can wrap the button in an `<a>` tag. Here's a code example: 57 58```html 59<a href="https://example.com"> 60 <button>Click me!</button> 61</a> 62``` 63 64### Details 65 66The `<details>` element can make a toggle-able dropdown without using any JavaScript. Here's a code example: 67 68```html 69<details> 70 <summary>Click me!</summary> 71 <p>Lorem ipsum dolor sit amet.</p> 72</details> 73``` 74 75### More 76 77To learn about other HTML elements and how to write HTML, visit [W3Schools/html](https://www.w3schools.com/html/). 78 79## Themes 80 81You can use custom colors and custom fonts in dev.css through themes. See the `/theme` folder to view some premade ones. You can also copy the `boilerplate.css` and make a theme yourself. Simply apply it after the dev.css stylesheet. For example, to apply the terminal theme, put this after your main stylesheet: 82 83```html 84<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/dev.css@2/theme/terminal.min.css"> 85```