https://github.com/alexerlandsson/tiny-grid
This is a lightweight CSS grid framework used to build responsive websites and applications. With just a size of 4KB minified (< 1KB gzipped), it is hard to find a smaller framework with the same possibilities.
https://github.com/alexerlandsson/tiny-grid
css-grid grid scss smaller-framework
Last synced: 9 months ago
JSON representation
This is a lightweight CSS grid framework used to build responsive websites and applications. With just a size of 4KB minified (< 1KB gzipped), it is hard to find a smaller framework with the same possibilities.
- Host: GitHub
- URL: https://github.com/alexerlandsson/tiny-grid
- Owner: alexerlandsson
- License: mit
- Created: 2016-08-30T18:25:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-06-19T08:56:44.000Z (over 1 year ago)
- Last Synced: 2025-03-23T18:53:01.275Z (10 months ago)
- Topics: css-grid, grid, scss, smaller-framework
- Language: SCSS
- Homepage:
- Size: 345 KB
- Stars: 31
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tiny Grid
This is a lightweight CSS grid framework used to build responsive websites and applications. With just a size of 4KB minified (< 1KB gzipped), it is hard to find a smaller framework with the same possibilities.
## Quick Start
To use Tiny Grid in your project, download the CSS file `tiny-grid.min.css` located in the folder name css and include it in the head of you html page.
```html
```
### The SCSS way
If you're using SCSS in you project, you could donwload the SCSS file instead. It is named `tiny-grid.scss` and located in the folder names scss. If you're doing it this way, you have more possibilities to customize the frameworks with your own breakpoints etc.
## Markup
Tiny Grid uses the same markup as Bootstrap's grid to make it easy to use for everyone. Example of the markup can be seen below:
```html
This is a column
This is another column
```
### Container
Container is a class to use to wrap all page content. The max-width is set by changing the `$grid-container-max-width` variable.
### Row
Rows should always wrap columns. This div contains negative margin to remove the padding from the outer columns.
```html
```
### Columns
Breakpoint columns defines the width of the column in a certain breakpoint and up. Note that this frameworks uses `min-width` in the media queries.
The breakpoints could be defined in the `$grid-breakpoints` map. As default, Tiny Grid comes with the breakpoints `sm`, `md`, `lg` and `xl`.
As default, the grid system builds on a 12-column system. This could easily be changed by changing the `$grid-columns` variable to desired value.
#### Column construction
To construct a column, use the class `col-` followed by a breakpoint name and then a width (1 to 12).
```html
```
This example creates a column which will be 33.333% wide (4/12) in the md breakpoint and up.
#### Responsive columns
It is possible to use different column widths in different breakpoints. To do so, just add multiple `col-` classes.
```html
```
#### Column offset
To add a offset to a column, use the `col-` class followed by breakpoint name, `-offset-` and then a width (1 to 12).
```html
```
### No-breakpoint depended columns
To add a column that is not depended by a breakpoint, just ignore the breakpoint name in the class construciton.
```html
```
## Browser Compatibility
|  |  |  |  |  |
|-----|-----|-----|-----|-----|
|
Yes | Yes | Yes | Yes | 8+ |
## License
The MIT License (MIT)
Copyright (c) 2016 Alexander Erlandsson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.