@intergrav/dev.css 2.0.11 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,84 +1,120 @@
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
-
5
- Extremely simple, small, classless CSS framework in the style of Vercel's Geist. Inspired by [xz/new.css](https://github.com/xz/new.css).
6
-
7
- The minified stylesheet weighs only **~5kb** and can make any plain HTML file look clean and modern.
8
-
9
- It 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
-
13
- In 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
-
19
- I 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
-
38
- dev.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
-
42
- Use 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
-
44
- For 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
-
46
- If 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
-
48
- Optionally, 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
-
52
- Wrap 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
-
56
- For 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
-
66
- The `<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
-
77
- To learn about other HTML elements and how to write HTML, visit [W3Schools/html](https://www.w3schools.com/html/).
78
-
79
- ## Themes
80
-
81
- You 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
- ```html
83
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/dev.css@2/theme/terminal.min.css">
84
- ```
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
+
5
+ Tiny, simple, classless CSS framework in the style of Vercel's [Geist](https://vercel.com/geist) design system. Inspired by [xz/new.css](https://github.com/xz/new.css).
6
+
7
+ The minified stylesheet weighs only **~4.8kb** and can make any plain HTML file look clean and modern. It also has a light and dark theme.
8
+
9
+ <details>
10
+ <summary>Preview</summary>
11
+
12
+ <img src="https://raw.githubusercontent.com/intergrav/branding/main/dev.css/preview/desktop-light.png" alt="dev.css desktop demo, light mode">
13
+ <img src="https://raw.githubusercontent.com/intergrav/branding/main/dev.css/preview/desktop-dark.png" alt="dev.css desktop demo, dark mode">
14
+ <img height="748px" src="https://raw.githubusercontent.com/intergrav/branding/main/dev.css/preview/mobile-light.png" alt="dev.css mobile demo, dark mode">
15
+ <img height="748px" src="https://raw.githubusercontent.com/intergrav/branding/main/dev.css/preview/mobile-dark.png" alt="dev.css mobile demo, dark mode">
16
+
17
+ </details>
18
+
19
+ ## Importing
20
+
21
+ In your HTML's `<head>` all you have to write is this, and you're done! (`.min` means to minify the file)
22
+
23
+ ```html
24
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/dev.css@3">
25
+ ```
26
+
27
+ I 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 if those are not available.
28
+
29
+ ### Geist Font
30
+
31
+ ```html
32
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/fonts@1/serve/geist.min.css">
33
+ ```
34
+
35
+ Recommended monospace variant:
36
+
37
+ ```html
38
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/fonts@1/serve/geist-mono.min.css">
39
+ ```
40
+
41
+ ### Inter Font
42
+
43
+ ```html
44
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/fonts@1/serve/inter.min.css">
45
+ ```
46
+
47
+ ## Elements
48
+
49
+ dev.css takes advantage of semantic HTML elements. Here are some guidelines on how these should be used for the best results.
50
+
51
+ ### Header
52
+
53
+ Use 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.
54
+
55
+ For 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.
56
+
57
+ If 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.
58
+
59
+ Optionally, 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.
60
+
61
+ ### Footer
62
+
63
+ Optionally, use the `<footer>` tag to create a footer for your page. Only use this at the bottom of your `<body>`, or else it may look wonky. You can add whatever content in here that you'd like.
64
+
65
+ ### Text
66
+
67
+ Wrap 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.
68
+
69
+ ### Button
70
+
71
+ For a link button, you can wrap the button in an `<a>` tag. Here's a code example:
72
+
73
+ ```html
74
+ <a href="https://example.com">
75
+ <button>Click me!</button>
76
+ </a>
77
+ ```
78
+
79
+ ### Details
80
+
81
+ The `<details>` element can make a toggle-able dropdown without using any JavaScript. Here's a code example:
82
+
83
+ ```html
84
+ <details>
85
+ <summary>Click me!</summary>
86
+ <p>Lorem ipsum dolor sit amet.</p>
87
+ </details>
88
+ ```
89
+
90
+ ### More
91
+
92
+ To learn about other HTML elements and how to write HTML, visit [W3Schools/html](https://www.w3schools.com/html/).
93
+
94
+ ## Addons
95
+
96
+ dev.css at the minimum is very basic. Addons are small CSS snippets that adjust or add on to the functionality of dev.css, based on what you want for your users. Examples include turning the header into a sidebar, or making the header sticky. If you are adding an addon, it must be added **after** the main dev.css file. You might also need order them in a specific way to make it work. Here are a few built-in addons.
97
+
98
+ ### `header-sticky.css`
99
+
100
+ This makes the header sticky - always at the top of the screen. Keep in mind that I do not recommend using this if your header is large, as it could affect usability of your site since it'll always be onscreen and will take up a lot of space. Only use it if your header is small, e.g. only contains a one-line `<h1>` and `<nav>`.
101
+
102
+ ```html
103
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/dev.css@3/addon/header-sticky.min.css">
104
+ ```
105
+
106
+ ### `header-sidebar.css`
107
+
108
+ This turns the header into a sidebar on displays that are wide enough to support it. It will list the navigation out vertically in this mode. It will responsively turn back into the default state if the viewport is too thin to contain everything. If you are using this with `header-sticky.css`, be sure to add it **after** that rather than before. To import it, add this line after `dev.css`:
109
+
110
+ ```html
111
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/dev.css@3/addon/header-sidebar.min.css">
112
+ ```
113
+
114
+ ## Themes
115
+
116
+ You 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:
117
+
118
+ ```html
119
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intergrav/dev.css@3/theme/terminal.min.css">
120
+ ```
@@ -0,0 +1,35 @@
1
+ /* addon for dev.css v3, a classless CSS framework - https://github.com/intergrav/dev.css */
2
+ /* warn: if using with the header-sticky addon, be sure to include this after it */
3
+
4
+ @media (min-width: calc((48rem + 4rem) + ((16rem)*2))) {
5
+ /* unset header */
6
+ header {
7
+ all: unset;
8
+ }
9
+
10
+ header {
11
+ padding: 3rem 2rem;
12
+ padding-right: 0;
13
+ position: fixed;
14
+ top: 0;
15
+ left: calc(50% - ((48rem + 4rem) / 2) - (16rem));
16
+ width: 16rem;
17
+ height: calc(100% - 6rem);
18
+ overflow-y: auto;
19
+ }
20
+
21
+ header nav ul {
22
+ padding-left: 1rem;
23
+ border-top: 1px solid var(--dc-bg-3);
24
+ padding-top: 1rem;
25
+ margin-top: 1rem;
26
+ }
27
+
28
+ header nav ul li {
29
+ display: list-item;
30
+ }
31
+
32
+ header nav ul li:not(:first-child)::before {
33
+ content: unset;
34
+ }
35
+ }
@@ -0,0 +1,8 @@
1
+ /* addon for dev.css v3, a classless CSS framework - https://github.com/intergrav/dev.css */
2
+ /* warn: if using with the header-sidebar addon, be sure to include this before it */
3
+ /* warn: i do not recommend using this if your header is large, may affect usability */
4
+
5
+ header {
6
+ position: sticky;
7
+ top: 0;
8
+ }