├── .github └── FUNDING.yml ├── README.md ├── bower.json ├── docs.css ├── favicon.ico ├── favicon.png ├── index.html ├── package.json ├── ungrid-screenshot.png ├── ungrid.css └── ungrid.min.css /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: chrisnager 4 | open_collective: ungrid 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![ungrid logo](../gh-pages/favicon.png "ungrid logo") 2 | 3 | # ungrid [![npm version](https://badge.fury.io/js/ungrid.svg)](http://badge.fury.io/js/ungrid) [![Bower version](https://badge.fury.io/bo/ungrid.svg)](http://badge.fury.io/bo/ungrid) 4 | 5 | the simplest responsive css grid 6 | 7 | 8 | 9 | ## What's this? 10 | 11 | __ungrid__ is a tiny, responsive, table-based CSS grid system. The entire `ungrid.css` file is 97 bytes minified. 12 | 13 | ```css 14 | @media (min-width: 30em) { 15 | .row { width: 100%; display: table; table-layout: fixed; } 16 | .col { display: table-cell; } 17 | } 18 | ``` 19 | 20 | 21 | 22 | ## Get started 23 | 24 | - Install with [npm](//www.npmjs.com/package/ungrid) `npm install ungrid` 25 | - Install with [Bower](//bower.io) `bower install ungrid` 26 | - Or just copy and paste the contents of ungrid.min.css into your CSS file. 27 | 28 | 29 | 30 | ## How to use 31 | 32 | To use, simply put as many `.col`s as you wish in your `.row`s and the `.col`s will automatically be evenly spaced. This allows you to roll your own simple grids. [See it in action](//codepen.io/chrisnager/pen/ypokv?editors=1100). 33 | 34 | ```html 35 |
36 |
37 |
38 |
39 | … 40 |
41 |
42 | ``` 43 | 44 | ![ungrid grid system](../gh-pages/ungrid-screenshot.png "ungrid grid system") 45 | 46 | 47 | 48 | ## Helpful resources 49 | 50 | - [Nested rows with ungrid](//codepen.io/chrisnager/pen/EeJqH) (addresses [issue #1](//github.com/chrisnager/ungrid/issues/1)). 51 | - [Gutters with ungrid](//codepen.io/chrisnager/pen/arKBu) (addresses [issue #2](//github.com/chrisnager/ungrid/issues/2)). 52 | - [Offset columns with ungrid](//codepen.io/chrisnager/pen/QbqxJO) (addresses [issue #6](//github.com/chrisnager/ungrid/issues/6)). 53 | - [Use ungrid with React](//codepen.io/chrisnager/pen/oYRzPz) (addresses [issue #13](//github.com/chrisnager/ungrid/issues/13)). 54 | - [Flexbox flavor (ungrid-flex.css)](//codepen.io/chrisnager/pen/BNejRQ) (addresses [pull request #4](//github.com/chrisnager/ungrid/pull/4)). 55 | 56 | 57 | 58 | ## License 59 | 60 | The MIT License (MIT) 61 | 62 | Copyright (c) 2014-2020 [Chris Nager](//twitter.com/chrisnager) 63 | 64 | Permission is hereby granted, free of charge, to any person obtaining a copy of 65 | this software and associated documentation files (the "Software"), to deal in 66 | the Software without restriction, including without limitation the rights to 67 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 68 | the Software, and to permit persons to whom the Software is furnished to do so, 69 | subject to the following conditions: 70 | 71 | The above copyright notice and this permission notice shall be included in all 72 | copies or substantial portions of the Software. 73 | 74 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 75 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 76 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 77 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 78 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 79 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 80 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ungrid", 3 | "description": "The simplest responsive css grid.", 4 | "version": "1.1.0", 5 | "homepage": "http://chrisnager.github.io/ungrid/", 6 | "authors": "Chris Nager <@chrisnager>", 7 | "keywords": [ 8 | "ungrid", 9 | "css", 10 | "grid", 11 | "grid system", 12 | "simple", 13 | "simplest", 14 | "responsive", 15 | "tiny", 16 | "small", 17 | "table-based", 18 | "framework" 19 | ], 20 | "main": "ungrid.css", 21 | "ignore": [ 22 | "index.html", 23 | "docs.css", 24 | "ungrid-screenshot.png", 25 | "favicon.ico", 26 | "favicon.png" 27 | ], 28 | "license": "MIT" 29 | } 30 | -------------------------------------------------------------------------------- /docs.css: -------------------------------------------------------------------------------- 1 | html { 2 | font: 24px/1.7 "Helvetica Neue", sans-serif; 3 | text-align: center; 4 | color: #222; 5 | } 6 | 7 | body { 8 | margin: 0; 9 | } 10 | 11 | a { 12 | text-decoration: none; 13 | color: teal; 14 | } 15 | 16 | h1 { 17 | letter-spacing: -0.05em; 18 | } 19 | 20 | h2 { 21 | font-size: 0.83333em; 22 | } 23 | 24 | p { 25 | font-size: 0.7em; 26 | } 27 | 28 | pre { 29 | border: 2px solid; 30 | padding: 1em; 31 | white-space: pre-wrap; 32 | font-size: 0.54167em; 33 | text-align: left; 34 | background-color: #fff; 35 | } 36 | 37 | .info__inner > p > code { 38 | padding: 0.25em; 39 | border-radius: 4px; 40 | border: 1px solid #bbb; 41 | } 42 | 43 | hr { 44 | max-width: 20em; 45 | margin: 2em auto; 46 | border: solid #ddd; 47 | border-width: 1px 0 0; 48 | } 49 | 50 | .header { 51 | padding: 3em 1em; 52 | } 53 | 54 | .header > h1, 55 | .header > p { 56 | margin-top: 0; 57 | margin-bottom: 0; 58 | } 59 | 60 | .info { 61 | padding: 2em 1em; 62 | overflow: hidden; 63 | background-color: #f2f2f2; 64 | } 65 | 66 | .info__inner { 67 | max-width: 30em; 68 | margin-right: auto; 69 | margin-left: auto; 70 | } 71 | 72 | .row { 73 | margin-top: 1em; 74 | margin-bottom: 1em; 75 | } 76 | 77 | @media (max-width: 479px) { 78 | .col { 79 | width: 100% !important; 80 | } 81 | } 82 | 83 | .col { 84 | height: 4em; 85 | vertical-align: middle; 86 | line-height: 4em; 87 | background-color: teal; 88 | } 89 | 90 | .col:nth-of-type(2n) { 91 | background-color: #95cbcb; 92 | } 93 | 94 | .footer { 95 | padding: 0.5rem 1rem 1.5em; 96 | } -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisnager/ungrid/4d749702834b8420c5f972b40d54962a8c3a2e99/favicon.ico -------------------------------------------------------------------------------- /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisnager/ungrid/4d749702834b8420c5f972b40d54962a8c3a2e99/favicon.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ungrid - the simplest responsive css grid 7 | 8 | 9 | 10 | 11 | 12 |
13 |

ungrid

14 |

by @chrisnager

15 |

the simplest responsive css grid

16 |
17 | 18 |
19 |
20 |

ungrid is a responsive, table-based CSS grid system. To use, simply put as many .cols as you wish in your .rows and the .cols will automatically be evenly spaced. This allows you to roll your own simple grids.

21 |

22 |
23 |

ungrid.css (97 bytes minified):

24 |
@media (min-width: 30em) {
 25 |     .row { width: 100%; display: table; table-layout: fixed; }
 26 |     .col { display: table-cell; }
 27 | }
28 |
29 |
30 | 31 |
32 |
33 |
34 | 35 |
36 |
37 |
38 |
39 | 40 |
41 |
42 |
43 |
44 |
45 | 46 |
47 |
48 |
49 |
50 |
51 |
52 | 53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | 61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | 70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | 81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | 94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | 109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | 128 |
129 |
130 |

Need specific column widths?

131 |

Go for it. Both fixed and percentage base widths work perfectly. You can even use them together. The remaining columns will take up the rest of the available space.

132 |
133 |
134 | 135 |
136 |
80%
137 |
138 |
139 | 140 |
141 |
40%
142 |
20%
143 |
40%
144 |
145 | 146 |
147 |
148 |
425px
149 |
150 | 151 |
152 |
15%
153 |
200px
154 |
155 |
25%
156 |
157 | 158 | 161 | 162 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ungrid", 3 | "version": "1.0.1", 4 | "description": "the simplest responsive css grid", 5 | "main": "ungrid.css", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/chrisnager/ungrid.git" 12 | }, 13 | "keywords": [ 14 | "ungrid", 15 | "grid", 16 | "responsive", 17 | "simple", 18 | "css", 19 | "simplest" 20 | ], 21 | "author": "Chris Nager (http://chrisnager.com)", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/chrisnager/ungrid/issues" 25 | }, 26 | "homepage": "https://github.com/chrisnager/ungrid" 27 | } 28 | -------------------------------------------------------------------------------- /ungrid-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisnager/ungrid/4d749702834b8420c5f972b40d54962a8c3a2e99/ungrid-screenshot.png -------------------------------------------------------------------------------- /ungrid.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 30em) { 2 | .row { width: 100%; display: table; table-layout: fixed; } 3 | .col { display: table-cell; } 4 | } 5 | -------------------------------------------------------------------------------- /ungrid.min.css: -------------------------------------------------------------------------------- 1 | @media(min-width:30em){.row{width:100%;display:table;table-layout:fixed}.col{display:table-cell}} 2 | --------------------------------------------------------------------------------