UI ELEMENTS
These css classes are design to do lots of common and recurring tasks.
Ink has a set of CSS classes that allow you to change several aspects of your user interface depending on the breakpoint. This allows for precise control and can help you do more than just change the width of layout blocks.
Class name | Description |
---|---|
align-left |
Sets text-align css property to 'left'. |
align-center |
Sets text-align css property to 'center'. |
align-right |
Sets text-align css property to 'right'. |
push-left |
Sets float css property to 'left'. |
push-center |
Sets float css property to 'none', and margin to '0 auto'. |
push-right |
Sets float css property to 'right'. |
top-space |
Sets margin-top to a full gutter space. |
right-space |
Sets margin-right to a full gutter space. |
bottom-space |
Sets margin-bottom to a full gutter space. |
left-space |
Sets margin-left to a full gutter space. |
vertical-space |
Sets margin-top and margin-bottom to a full gutter space. |
horizontal-space |
Sets margin-left and margin-right to a full gutter space. |
hide |
Sets display css property to 'none'. |
show |
Sets display css property to its default visible state. |
large-class-name
.half-class-name
.push-left
push-center
push-right
Lets take two buttons and align them to the sides of their container:
Demo
Since by default items are aligned to the left we only have to align the 'confirm' button to the right:
Code
We can do the same but for a specific breakpoint, large
in this example:
Demo
Code
Beware that centering elements with push-center
uses the margin: 0 auto
method and will only work with elements that have a width other than auto, like grid columns.
Demo
align-left
align-center
align-right
If you need to align content within your blocks, you can use the align-left
, align-center
or align-right
classes.
Demo
This is some right aligned text, using the align-right
class.
Code
space
top-space
right-space
bottom-space
left-space
Sometimes extra space is essential and so Ink ships with a few simple spacer classes. Add one of the above classes to any block level element to obtain the desired space.
show-all
hide-all
show
hide
With the .show
and hide
classes you can force an element to be shown or hidden.
Note that these classes use !important
to avoid any conflicts.
The bar below will display different values and colors depending on the size of the screen it's being viewed on.
Demo
Screen size:
Code