Responsive utilities for responsive panels

Contrary to the vast majority of responsive utilities developped, evfdm is not based on the media screen query. Instead, each viewport can have a different "media size" which will determine how the elements inside will respond. This allow for much more dynamic comportement (for instance, some part of the page being collapsed while other are not).

Behold ! Imbricated viewport of different size are not supported right now for instance, a `view-sm` inside a `view-lg`. Your viewport have to be siblings.

Grid system

The possibilities are the same as the bootstrap grid.

Example: Stacked to horizontal

Using a single set of .col-md-* grid classes, you can create a basic grid system that starts out stacked in extra small to small container before becoming horizontal on medium+ container. Place grid columns in any .row.

.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-8
.col-md-4
.col-md-4
.col-md-4
.col-md-4
.col-md-6
.col-md-6

Example: Extra Small and Medium container

.col-xs-12 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6
.col-xs-6

Example: Extra Small, Small, and Medium container

Build on the previous example by creating even more dynamic and powerful layouts with `.col-sm-*` classes.

.col-xs-12 .col-sm-6 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4

Offsetting columns

Move columns to the right using `.col-md-offset-*` classes. These classes increase the left margin of a column by * columns. For example, `.col-md-offset-4` moves `.col-md-4` over four columns.

.col-md-4
.col-md-4 .col-md-offset-4
.col-md-3 .col-md-offset-3
.col-md-3 .col-md-offset-3
.col-md-6 .col-md-offset-3

Column ordering

Easily change the order of our built-in grid columns with .col-md-push-* and .col-md-pull-* modifier classes.

.col-xs-9 .col-md-push-3
.col-xs-3 .col-md-pull-9

Container

Like in bootstrap, you can use the responsive class container to format content.

I'm in a container !

Responsive utilities

Visible on...

Green checkmarks indicate the element is visible in your current viewport.

✔ Visible on x-small
✔ Visible on small
Medium ✔ Visible on medium
✔ Visible on large
✔ Visible on x-small and small
✔ Visible on medium and large
✔ Visible on x-small and medium
✔ Visible on small and large
✔ Visible on x-small and large
✔ Visible on small and medium

Hidden on...

Here, green checkmarks also indicate the element is hidden in your current viewport.

✔ Hidden on x-small
✔ Hidden on small
Medium ✔ Hidden on medium
✔ Hidden on large
✔ Hidden on x-small and small
✔ Hidden on medium and large
✔ Hidden on x-small and medium
✔ Hidden on small and large
✔ Hidden on x-small and large
✔ Hidden on small and medium

Responsive Viewport directive

This directive is responsible for putting the proper ev-viewport-*size* class on a container depanding on its size. For performance reason it doesn't watch the width of the element. So each time a resize happens, the event module-layout-changed must be triggered in order for the class to update if the size has changed.

The default upper limits are are <300px very small, <450px small, <700px medium and >=700px large. They can be overriden.

.col-xs-12 .col-sm-6 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4

Limit classes

It is possible to specify a max size and min size for viewport well, with the classes ev-min-*size* and ev-max-*size. For instance, if you want a viewport that don't go below md size, you can add ev-min-md

Below is a div with the class ev-min-sm et ev-max-md

✔ Hidden on x-small
✔ Hidden on small
Medium ✔ Hidden on medium
✔ Hidden on large