Buzuki

A mobile-first, responsive BEM flavoured flexbox css grid system.

Tags

There are 5 viewport sizes out-of-the-box, each with an associated @tag.

Modifiers with tags will only apply when the viewport reaches the size specified.

No @tag

Works across all viewport sizes

@xs

Minimum viewport size: 0px

@sm

Minimum viewport size: 544px

@md

Minimum viewport size: 768px

@lg

Minimum viewport size: 992px

@xl

Minimum viewport size: 1200px

Blocks

Each component may be used independently or in unison, you decide.

Content

Defines a section of page content contained within a 1200px (max) wide area.

Row

Defines a horizontal grouping of cells that can be mangled to meet even the gnarliest of layouts.

Cell

Defines a region of content that abides by the rules governed upon it, keeping your pages sane.

Codepen Example

See the Pen Buzuki grid example by Buzuki (@pixls) on CodePen.

Modifiers

All modifiers (except Cell--has-rows) support viewport @tags.

Like what Row--flow-reversed is doing, but only want it on desktop? Try Row--flow-reversed@xl

Does Cell--6/12 tickle your fancy, but you want it to be a Cell--12/12 on mobile? Throw these two together "Cell--12/12@xs Cell--6/12@sm"

Bada bing, bada boom.


.Row--flow-standard
.Row--flow-reversed

If you want cells to appear in natural DOM order, flow-standard will do just that. It's what a row does by default. If you need cells to appear right to left (in opposite DOM order), try flow-reversed.

flow-standard
Cell 1
Cell 2
Cell 3
flow-reversed
Cell 1
Cell 2
Cell 3

.Row--finish-short
.Row--finish-tall

Cells have gutters around all edges, which means you'll have a horizontal gutter underneath rows by default. Using finish-short makes sure that the content under a row will start directly after it. Using finish-tall means content under a row will be preceded by a gutter.

finish-short
Row 1
Row 2
finish-tall
Row 1
Row 2

.Row--no-gutters
.Row--gutters

Cells have gutters around all edges, which means there will be horizontal and vertical gaps between all cells present in a row by default. Specifying no-gutters will remove these gutters and all cells will directly touch each other, like a pack of sardines. Using gutters means cells will have breathing room.

no-gutters
Cell 1
Cell 2
Cell 3
Cell 4
gutters
Cell 1
Cell 2
Cell 3
Cell 4

.Row--valign-baseline
.Row--valign-center
.Row--valign-flex-end
.Row--valign-flex-start
.Row--valign-stretch

Using these alignment modifiers, you can vertically organise all cells present in a row. As rows use flexbox as the underlying display property, these modifiers follow the same rules as set out by the css spec "align-items" property.

baseline
Cell 1
Cell 2
Cell 3
center
Cell 1
Cell 2
Cell 3
flex-end
Cell 1
Cell 2
Cell 3
flex-start
Cell 1
Cell 2
Cell 3
stretch
Cell 1
Cell 2 with a little more information inside of it.
Cell 3

.Cell--#/#

Here, #/# denotes any whole-number fraction of the columns availabe, which is 12 by default. This makes thing simple and readable. Need a cell that's 6 columns wide? Use Cell--6/12. Need 3 columns worth? Cell--3/12, etc.

example 1
Cell--4/12
Cell--4/12
Cell--4/12
example 2
Cell--6/12
Cell--6/12
example 3
Cell--4/12
Cell--5/12
Cell--3/12

.Cell--offset-left-#/#
.Cell--offset-right-#/#

Cell offsets follow the same sizing property as Cell--#/#. So if you want a cell to have a left offset of 2 columns, chuck on Cell--offset-left-2/12. Need a right offset of 8 columns worth? Cell--offset-right-8/12, simple.

offset-left
Cell--6/12 +
Cell--offset-left-6/12
offset-right (with .Row--flow-reversed)
Cell--6/12 +
Cell--offset-right-3/12

.Cell--hidden
.Cell--visible

These are fairly self explanatory, so we'll move on.

hidden (use your imagination...)
Cell 1
Cell 2
Cell 3
visible
Cell 1
Cell 2
Cell 3

.Cell--align-left
.Cell--align-center
.Cell--align-right
.Cell--align-justify

These alignment modifiers follow the same rules as specified by the css "text-align" property. Simply put, these modifiers are here as a convenience to you, saving you from having to write an additional class to align your text if that's all you're looking for.

align-left
Etiam porta sem malesuada magna mollis euismod. Vestibulum id ligula porta felis euismod semper. Donec id elit non mi porta gravida at eget metus. Ultricies Dolor Cras Egestas.
align-center
Etiam porta sem malesuada magna mollis euismod. Vestibulum id ligula porta felis euismod semper. Donec id elit non mi porta gravida at eget metus. Ultricies Dolor Cras Egestas.
align-right
Etiam porta sem malesuada magna mollis euismod. Vestibulum id ligula porta felis euismod semper. Donec id elit non mi porta gravida at eget metus. Ultricies Dolor Cras Egestas.
align-justify
Etiam porta sem malesuada magna mollis euismod. Vestibulum id ligula porta felis euismod semper. Donec id elit non mi porta gravida at eget metus. Ultricies Dolor Cras Egestas.

.Cell--has-rows

I've left this one till last. For more advanced layouts, like those wrangled up by your designers 😜. If a cell has rows embedded within it (as used throughout the examples) this modifier will ensure the gutters are taken care of. Interested? Inspect the source.

has-rows
Cell 1
Cell 2
Cell 3

Customisation

Anything you see marked in yellow on this page can be modified.

When importing Buzuki via Sass, you may override any of the settings.

More or less columns? Different breakpoints? Different content width? No problem.

License

Created by Tristan Strathearn. Licensed under the MIT license.

Github and Scissor icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY