mdo/table-grid
소개
`display: table;`을 사용하는 간단한 CSS 그리드 시스템입니다.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalTable Grid
Every grid to date uses floats or some inline-block hackery. That's so 2013 though, and seeing that it's now 2014, we need something newer, faster, and stronger. So, Table Grid was born.
Check out the example on GitHub Pages at http://mdo.github.io/table-grid/. Clone this or download it to give it a whirl for yourself.
Wtf
This isn't a serious project really, it's just an experiment. I'm curious about the rendering performance of using display: table; as opposed to floats, flex-box, or display: inline-block;. Each option has pros or cons, but in particular I'm focused on the con part:
floats require clearing and I have zero idea about rendering performance. They're straightfoward and Just Work™.flex-boxhas poor rendering last I heard because browsers have to do a lot of repainting to support it. I have no references to this, it's what I've heard. Plus, browser support and what not.display: inline-block;is gnarly because it involves resettingwhite-spaceand that's just silly. We shouldn't be resetting that kind of stuff just for a grid system.
So, based on that, display: table; starts to sound kind of interesting. Table layouts, especially ones that include table-layout: fixed; render super fast because browsers only need to render the first row of cells to paint the whole table. That's kind of moot with one row grids like this, but it might help anyway.
How it works
As always, there's a container, row, and a series of columns. It's responsive, too. More specifically:
- Center the site contents with
.container, which has amax-width: 940px;. - Wrap a row of columns with
.grid. This sets up the table-based grid withdisplay: table;,width: 100%;, andtable-layout: fixed;. - Columns get the
.colbase class and an optional width class, like.col-1or.col-6. There are 12 available column classes, 1-12, for any variety of column combinations. - Grid width class is not required. Without them, all columns become equal width via
.colalone. Tables, baby! - Grids are nestable—just place a new
.gridwithin any.col. Bam. - By default, because of how
display: table;works, there's no gutters. To add gutters, wrap the.gridin.grid-padded, which adds gutters withborder-spacing: 1rem 0;. Sucks, but this is experimental.
All this can be seen in action on the demo page.
What's included
Table Grid has been rebuilt to use Sass (thanks, Jekyll!). Key CSS bits are broken down in _sass:
grid-basics.scsscontains the container and basic responsive, equal-width column support.grid-columns.scsscontains specific column width classes for more granular control (e.g,.col-6is 50% wide).grid-extras.scssis for alignment and sorting options.
See http://mdo.github.io/table-grid/ for details on usage.
Fuck you, where's the real grid?
If you need a nuclear hardened grid system, check out Bootstrap. It's okay.
License
MIT, (c) Mark Otto 2014.
관련 프로젝트 살펴보기
불러오는 중…