Utilities

Floats

Elements can be floated with .align-* classes. Add a .clearfix class to a parent element to clear the floats.

Float's should generally be avoided, we're not in the early 00's anymore!

    
  
Float Right
Float Left
Float None

Margin, padding and borders

Use m*-0, p*-0 and b*-0 modifiers to reset margin/padding/border to 0 for a given side.

  • Margin:
    • m-0 sets margin: 0px !important
    • mt-0 sets margin-top: 0px !important
    • mr-0 sets margin-right: 0px !important
    • mb-0 sets margin-bottom: 0px !important
    • ml-0 sets margin-left: 0px !important
    • mb sets margin-bottom: $element-margin !important
  • Padding:
    • p-0 sets padding: 0px !important
    • pt-0 sets padding-top: 0px !important
    • pr-0 sets padding-right: 0px !important
    • pb-0 sets padding-bottom: 0px !important
    • pl-0 sets padding-left: 0px !important
  • Border:
    • b-0 sets border: 0px !important
    • bt-0 sets border-top: 0px !important
    • br-0 sets border-right: 0px !important
    • bb-0 sets border-bottom: 0px !important
    • bl-0 sets border-left: 0px !important

Display utilities

Jellyfish comes with a number of display utilities to allow you to hide and show elements based on the current breakpoint.

An element with a class of .hide is hidden at all breakpoints. An element can also be set to be hidden (but still take up space on the page) with the class .invisible.

Use .hide-* to hide an element only at a specific breakpoint. Use .hide-above-* to hide an element at and above a specific breakpoint. Use hide-below-* to hide an element at and below a specific breakpoint.

Class Result
.invisible
.hide This text will be hidden on all devices.
.hide-* hide-xshide-smhide-mdhide-lghide-xl
.hide-below-* hide-below-smhide-below-mdhide-below-lghide-below-xl
.hide-above-* hide-above-smhide-above-mdhide-above-lghide-above-xl

Working with flexboxes

Align items

Jellyfish contains a number of flexbox alignment classes to help position columns inside a flexbox row.

.align-* classes are added to the parent row to align elements vertically within a row. .align-self-* classes are applied to the columns themselves to achieve the same outcome.

    
  
align-top
align-top
align-top
align-middle
align-middle
align-middle
align-bottom
align-bottom
align-bottom
align-baseline
align-baseline
align-baseline
align-stretch (any elements inside the .col must be 100% height)
align-stretch (any elements inside the .col must be 100% height)
align-stretch (any elements inside the .col must be 100% height)
align-self-top
align-self-middle
align-self-bottom

Adding a class of .flex will convert any element into display: flex;. Apply an .equal-height class to a parent row to make all immediate child columns display:flex;

    
  
Flex item
Flex item with .flex converts this column to a flex. The child element has flex:1 which makes it take up 100% height.
equal-height
equal-height

Justify content

Use the .justify-* modifiers on a row to justify the child columns.

    
  
justify-start
justify-start
justify-start
justify-center
justify-center
justify-center
justify-end
justify-end
justify-end
justify-around
justify-around
justify-around
justify-between
justify-between
justify-between
justify-evenly
justify-evenly
justify-evenly

Manipulating width

The utility class .full-width can be applied to any element to make width: 100%.

An element with the utility class .vw-100 will span 100% of the viewport width, breaking out of any containers to do so (without affecting document flow). Note: this class should only be used when the center of the parent is in the center of the window.