Typeface
59 |Vanilla CSS will use whatever default system fonts are available for faster speed and optimization.
60 |├── README.md ├── LICENSE ├── favicon.svg ├── vanilla.css └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # Vanilla CSS 2 | 3 | Vanilla CSS is a minimal baseline stylesheet for any web project. It includes a basic reset and default styling for all HTML5 elements (which you can see live at vanillacss.com). 4 | 5 | ## Usage 6 | 7 | If you want to use this CSS directly in your project, simply download the stylesheet below and include the following in your HTML `head` section: 8 | 9 | ``` 10 | 11 | ``` 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Bradley Taunt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /favicon.svg: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /vanilla.css: -------------------------------------------------------------------------------- 1 | /* Reset */ 2 | html, body, div, span, applet, object, iframe, 3 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 4 | a, abbr, acronym, address, big, cite, code, 5 | del, dfn, em, img, ins, kbd, q, s, samp, 6 | small, strike, strong, sub, sup, tt, var, 7 | b, u, i, center, 8 | dl, dt, dd, ol, ul, li, 9 | fieldset, form, label, legend, 10 | table, caption, tbody, tfoot, thead, tr, th, td, 11 | article, aside, canvas, details, embed, 12 | figure, figcaption, footer, header, hgroup, 13 | menu, nav, output, ruby, section, summary, 14 | time, mark, audio, video { 15 | margin: 0; 16 | padding: 0; 17 | border: 0; 18 | font-size: 100%; 19 | font: inherit; 20 | vertical-align: baseline; 21 | } 22 | 23 | * { 24 | box-sizing: border-box; 25 | } 26 | 27 | /* Variables */ 28 | :root { 29 | --desktop-font-size: 1.2rem/1.55; 30 | --mobile-font-size: 1rem/1.45; 31 | --text-color: #2d2d2d; 32 | --link-color: blue; 33 | --link-color-alt: darkblue; 34 | --primary-color: lightsteelblue; 35 | --secondary-color: aliceblue; 36 | --tertiary-color: whitesmoke; 37 | } 38 | 39 | /* Typography */ 40 | body { 41 | color: var(--text-color); 42 | margin: 0 auto; 43 | max-width: 75ch; 44 | padding: 0 0.5rem; 45 | } 46 | body, input { 47 | font: var(--desktop-font-size) -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto, Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol"; 48 | } 49 | 50 | h1,h2,h3,h4,h5,h6,p,blockquote,dl,img,figure { 51 | margin: 2rem 0; 52 | } 53 | 54 | h1,h2,h3,h4,h5,h6 { font-weight: bold; line-height: 1.2; } 55 | h1 { font-size: 200%; } 56 | h2 { font-size: 150%; } 57 | h3 { font-size: 120%; } 58 | h4,h5,h6 { font-size: 100%; } 59 | h5, h6 { text-transform: uppercase; } 60 | 61 | header h1 { border-bottom: 1px solid; } 62 | 63 | a,a:visited { color: var(--link-color); } 64 | a:hover,a:focus { color: var(--link-color-alt); } 65 | 66 | strong, time, b { font-weight: bold; } 67 | em, dfn, i { font-style: italic; } 68 | sub { font-size: 60%; vertical-align: bottom; } 69 | small { font-size: 80%; } 70 | 71 | blockquote, q { 72 | background: var(--secondary-color); 73 | border-left: 10px solid var(--primary-color); 74 | display: block; 75 | font-family: "Georgia", serif; 76 | padding: 1rem; 77 | } 78 | blockquote p:first-child { margin-top: 0; } 79 | blockquote p:last-child { margin-bottom: 0; } 80 | cite { 81 | font-family: "Georgia", serif; 82 | font-style: italic; 83 | font-weight: bold; 84 | margin-top: 1rem; 85 | } 86 | 87 | kbd,code,samp,pre,var { font: var(--mobile-font-size) monospace; } 88 | code, pre { 89 | background: var(--tertiary-color); 90 | border: 1px solid; 91 | overflow: auto; 92 | padding: 0.25rem 0.5rem; 93 | } 94 | code pre , pre code { border: 0; padding: 0; } 95 | 96 | /* Elements */ 97 | hr { 98 | background: var(--text-color); 99 | border: 0; 100 | height: 1px; 101 | margin: 4rem 0; 102 | } 103 | 104 | img { 105 | display: block; 106 | height: auto; 107 | max-width: 100%; 108 | } 109 | 110 | figure { 111 | border: 1px solid var(--primary-color); 112 | display: inline-block; 113 | padding: 1rem; 114 | width: 100%; 115 | } 116 | figure img { margin: 0 auto; } 117 | figure figcaption { font-size: 80%; margin-top: 0.5rem; text-align: center; } 118 | 119 | ul, ol { margin: 2rem 0; padding: 0 0 0 2rem; } 120 | ul li, ol li { margin-bottom: 1rem; } 121 | li > ul, li > ol { margin: 0.25rem 0 0.5rem; padding: 0 0 0 2rem; } 122 | li > ul li, li > ol li { margin-bottom: 0.5rem; } 123 | 124 | dl dd { padding-left: 2rem; } 125 | 126 | table { 127 | border: 1px solid var(--primary-color); 128 | border-collapse: collapse; 129 | table-layout: fixed; 130 | text-align: left; 131 | width: 100%; 132 | } 133 | table caption { margin: 2rem 0; } 134 | table tr { border-bottom: 1px solid var(--primary-color); } 135 | table thead { position: sticky; top: 0; } 136 | table tbody tr:nth-child(even) { background: var(--tertiary-color); } 137 | table th { background: var(--secondary-color); font-weight: bold; } 138 | table th, table td { padding: 0.5rem; } 139 | 140 | input { 141 | appearance: none; 142 | border: 1px solid var(--text-color); 143 | display: block; 144 | margin: 0.5rem 0; 145 | padding: 0.8rem; 146 | } 147 | input:focus, input:active { background-color: var(--secondary-color); border-color: var(--link-color); } 148 | 149 | sup { font-size: 80%; vertical-align: top; } 150 | 151 | /* Mobile Styling */ 152 | @media screen and (max-width: 75ch) { 153 | body, input { 154 | font: var(--mobile-font-size) -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto, Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol"; 155 | } 156 | table { table-layout: auto; } 157 | } 158 | 159 | /* Dark mode support */ 160 | @media (prefers-color-scheme: dark) { 161 | body { 162 | background: #191919; 163 | } 164 | input:focus, input:active { 165 | background-color: var(--text-color); 166 | color: var(--secondary-color); 167 | } 168 | table, 169 | table tr, 170 | table th:not(:last-of-type), 171 | table td:not(:last-of-type) { 172 | border-color: var(--text-color); 173 | } 174 | table thead th, 175 | table tfoot th { 176 | background-color: var(--primary-color-light); 177 | } 178 | :root { 179 | --text-color: #fff; 180 | --link-color: orange; 181 | --link-color-alt: yellow; 182 | --primary-color: orange; 183 | --primary-color-light: dimgrey; 184 | --secondary-color: black; 185 | --tertiary-color: #2d2d2d; 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |Vanilla CSS is a minimal baseline stylesheet for any web project. It includes a basic reset and default styling for all HTML5 elements (which you can see live below).
15 |Download the main stylesheet from this project, then copy and paste the following inside your head element:
<link rel="stylesheet" href="vanilla.css">23 |
Or import directly in your own CSS:
24 |@import url('vanilla.css');
25 | This project is completely free and open source. Check it out on codeberg.
26 |Vanilla CSS will use whatever default system fonts are available for faster speed and optimization.
60 |A paragraph (from the Greek paragraphos, “to write beside” or “written beside”) is a self-contained unit of a discourse in writing dealing with a particular point or idea. A paragraph consists of one or more sentences. Though not required by the syntax of any language, paragraphs are usually an expected part of formal writing, used to organize longer prose.
81 |88 |92 |A block quotation (also known as a long quotation or extract) is a quotation in a written document, that is set off from the main text as a paragraph, or block of text.
89 |It is typically distinguished visually using indentation and a different typeface or smaller size quotation. It may or may not include a citation, usually placed at the bottom.
90 | Said no one, ever. 91 |
| Table Heading 1 | 144 |Table Heading 2 | 145 |Table Heading 3 | 146 |Table Heading 4 | 147 |
|---|---|---|---|
| Table Cell 1 | 152 |Table Cell 2 | 153 |Table Cell 3 | 154 |Table Cell 4 | 155 |
| Table Cell 1 | 158 |Table Cell 2 | 159 |Table Cell 3 | 160 |Table Cell 4 | 161 |
| Table Cell 1 | 164 |Table Cell 2 | 165 |Table Cell 3 | 166 |Table Cell 4 | 167 |
| Table Cell 1 | 170 |Table Cell 2 | 171 |Table Cell 3 | 172 |Table Cell 4 | 173 |
| Table Footer 1 | 178 |Table Footer 2 | 179 |Table Footer 3 | 180 |Table Footer 4 | 181 |
Keyboard input: Cmd
190 |Inline code: <div>code</div>
Sample output: This is sample output from a computer program.
192 |P R E F O R M A T T E D T E X T
194 | ! " # $ % & ' ( ) * + , - . /
195 | 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
196 | @ A B C D E F G H I J K L M N O
197 | P Q R S T U V W X Y Z [ \ ] ^ _
198 | ` a b c d e f g h i j k l m n o
199 | p q r s t u v w x y z { | } ~
200 | Strong is used to indicate strong importance.
208 |This text has added emphasis.
209 |The b element is stylistically different text from normal text, without any special importance.
210 |The i element is text that is offset from the normal text.
211 |The u element is text with an unarticulated, though explicitly rendered, non-textual annotation.
212 |This text is deleted and This text is inserted.
This text has a strikethrough.
Superscript®.
215 |Subscript for things like H2O.
216 |This small text is small for fine print, etc.
217 |Abbreviation: HTML
218 |This text is a short inline quotation.
This is a citation.
220 |The dfn element indicates a definition.
221 |The mark element indicates a highlight.
222 |The variable element, such as x = y.
223 |The time element:
224 |There is comment here:
231 |There is a comment spanning multiple tags and lines below here.
232 | 235 |<figure> element<figure> element, no <figcaption><figure> element, with a <figcaption>Very basic input styling is also supported:
260 | 261 | 262 | 263 |Looking for custom form styling?
267 |