Grid

A simple but powerful grid system.



Description

The Ueyen grid system allows creating a grid system that can be easily controlled and combined with other selectors (such as the width and height selector). The grid system is using flexbox to construct the grid structure.



Basic use

The following selectors class names can be used to create a simple 1-column to 6-column grid.



un-gr-1

1 item on each row.
Grid items will have 100% width.

un-gr-2

2 items on each row.

un-gr-3

3 items on each row.

un-gr-4

4 items on each row.

un-gr-5

5 items on each row.

un-gr-6

6 items on each row.



Example of basic use

The following class name un-gr-3 is assigned to the parent, so the children turn into a grid of 3-elements on each row



The children must be wrapped in a div tag. See the following markup sample.
If you decided to add extra padding around the grid container, wrap the grid container (the element with the class un-gr), and apply the padding to the wrapper of the grid container.


Markup

The content goes here...
The content goes here...
The content goes here...
The content goes here...


Grid and breakpoints

All the selectors in the basic mode can be followed by :s to :h (small to huge) to have different number of items on each row.



:s

Larger than Breakpoint Small

:m

Larger than Breakpoint Large.

:l

Larger than Breakpoint large.

:h

Larger than Breakpoint Huge.



Example of using grid with brekpoints

The following grid has these class names: un-gr-1 un-gr-2:s un-gr-3:m un-gr-4:l un-gr-5:h


The result will be:

un-gr-1 One item on each row by default.

un-gr-2:s 2 items after breakpoint small.

un-gr-3:m 3 items after breakpoint medium.

un-gr-4:l 4 items after breakpoint large.

un-gr-5:h 5 items after breakpoint huge.



Markup

The content goes here...
The content goes here...
The content goes here...
The content goes here...


Grid and width selectors

The width selectors can be used to have a custom width on each element in the grid.



Example of using width selectors in grids

The following class name un-w-1/2 is assigned to the first two elements, so they will be half of the size of the row, even though the grid is un-gr-4, which means 4 items on each row.



Markup

The content goes here...
The content goes here...
The content goes here...
The content goes here...
The content goes here...
The content goes here...
The content goes here...


Grid and height selectors

The height selectors can be used to have a custom height on each element in the grid.



Example of using height selectors in grids

The following class name un-h-l is assigned to the second element, and un-h-h to the third element, so the second element has large height "-l", and the third element has huge height "-h".



The class un-h*-m is a children-selector for height. It targets all the children of the element and gives them the medium height.



Markup

The content goes here...
The content goes here...
The content goes here...
The content goes here...




Nested grids

The grids can be nested inanother grid.



Example of nested grids

In the following sample, a grid of 3 .un-gr-3 in nested in a grid of 2.un-gr-2.



Markup

The content goes here...
The content goes here...
The content goes here...
The content goes here...
The content goes here...
The content goes here...