1.1.1 • Published 4 years ago

@miraidesigns/helpers v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Helpers

Collection of helpful CSS classes.


Sass

@forward '@miraidesigns/helpers/styles';

Transitions

Disable transitions generally or on a specific element.

NameDescription
mdf-preloadApply to the <body> element. Stops all transitions from firing
mdf-disable-transitionsStops transitions on the applied element

Floats

Float elements to the left or right of its parent allowing content to move around it.

NameDescription
mdf-float-leftFloat element to the left of the content
mdf-float-rightFloat element to the right of the content
mdf-clearfixApply clearfix to parent element, stops floating content from overflowing

Visibility

Hide elements in various ways.

NameDescription
mdf-hiddenHides an element by setting display to none
mdf-hidden-mobileHides an element on mobile devices by setting display to none
mdf-hidden-tabletsHides an element on tablets by setting display to none
mdf-hidden-laptopHides an element on laptops by setting display to none
mdf-offscreenMove the element offscreen but keep it content relevant to support ARIA practices

Sizes

Set the height or width of an element in percentages. Format is either mdf-h-* for height or mdf-w-* for width.

NameDescription
one-fifth20%
one-quarter25%
one-third33.3%
two-fifths40%
half50%
three-fifths60%
two-thirds66.666666667%
three-quarters75%
four-fifths80%
full100%

Spacing

Two simple classes to either reset an element's margin or padding.

NameDescription
mdf-margin-resetSet margin to 0
mdf-padding-resetSet padding to 0

Overflow

Hide an element's scrollbar or only show a horizontal or vertical one if necessary.

NameDescription
mdf-scrollbar-hiddenSet overflow to hidden
mdf-scrollbar-hSet overflow-x to auto displaying only a horizontal scrollbar if needed
mdf-scrollbar-vSet overflow-y to auto displaying only a vertical scrollbar if needed

Others

Miscellaneous helper classes that aren't part of a bigger "category".

NameDescription
mdf-roundRounds the edges of an element to make it circular. Sets border-radius to 50%
mdf-rotate-90Rotates an element by 90deg. Sets transform to rotate(90deg)
mdf-rotate-180Rotates an element by 180deg. Sets transform to rotate(180deg)
mdf-rotate-270Rotates an element by 270deg. Sets transform to rotate(270deg)