4.1.0 • Published 7 years ago

@getbase/layout-helpers v4.1.0

Weekly downloads
20
License
MIT
Repository
github
Last release
7 years ago

Base Layout Helpers

Base Layout Helpers is designed in a way where you can add it on top of the Base CSS framework or to your own custom project.

Travis Build Status David Dependencies Status


Table of contents


Overview

Base Layout Helpers contains styles for resetting margins, resetting paddings, resetting floats, setting position types and flex helpers for all breakpoints.


Installation

If you have an existing project and would like to include the Base layout helpers module, run the following command:

npm install --save @getbase/layout-helpers

Once you have the layout helpers module installed, you can include it in your CSS/LESS/SCSS file with one of the following ways:

CSS Import:

@import url("https://unpkg.com/@getbase/layout-helpers/index.css");

SCSS Import:

/* Import Base Layout Helpers */
@import "~@getbase/layout-helpers/scss/index";
/* Your Other Styles */
@import "main"

LESS Import:

/* Import Base Layout Helpers */
@import "~@getbase/layout-helpers/less/index";
/* Your Other Styles */
@import "main"

Documentation

Base Layout Helpers includes styles for resetting margins, resetting paddings, resetting floats, setting position types and flex helpers for all breakpoints.

Helpers (Applies to SCSS/LESS)

Helper ClassPurposeExampleOutcome
.no-marginApplies margin 0<div class="no-margin">No margin</div>Applies a margin of 0 to a div element for all breakpoints
.no-paddingApplies padding 0<div class="no-padding">No padding</div>Applies a padding of 0 to a div element for all breakpoints
.no-floatApplies float none<div class="no-float">No float</div>Applies a float of none to a div element for all breakpoints
.absoluteApplies position absolute<div class="absolute">Absolute</div>Applies a position of absolute to a div element for all breakpoints
.staticApplies position static<div class="static">Static</div>Applies a position of static to a div element for all breakpoints
.fixedApplies position fixed<div class="fixed">Fixed</div>Applies a position of fixed to a div element for all breakpoints
.noneApplies display none<div class="none">You won't see this text</div>Applies a display of none to a div element for all breakpoints
.blockApplies display block<span class="block">This will be a block element</span>Applies a display of block to a span element for all breakpoints
.inline-blockApplies display inline-block<div class="inline-block">This element will be inline-block</div>Applies a display of inline-block to a div element for all breakpoints
.inlineApplies display inline<div class="inline">This element will be inline</div>Applies a display of inline to a div element for all breakpoints
.flexApplies display flex<div class="flex">This element will be flex</div>Applies a display of flex to a div element for all breakpoints
.flex-rowApplies flex direction row<div class="flex flex-row">Flex direction will be row</div>Applies a flex direction of flex-row to a div element for all breakpoints
.flex-row-reverseApplies flex direction row-reverse<div class="flex flex-row-reverse">Flex direction will be row in reverse</div>Applies a flex direction of flex-row-reverse to a div element for all breakpoints
.flex-columnApplies flex direction column<div class="flex flex-column">Flex direction will be column</div>Applies a flex direction of flex-column to a div element for all breakpoints
.flex-column-reverseApplies flex direction column-reverse<div class="flex flex-column-reverse">Flex direction will be column reverse</div>Applies a flex direction of flex-column-reverse to a div element for all breakpoints
.flex-space-aroundApplies spacing around elements within a flex container<div class="flex flex-space-around">Flex space around is applied</div>Applies spacing around elements within a div element for all breakpoints
.flex-space-betweenApplies spacing between elements within a flex container<div class="flex flex-space-between">Flex space between is applied</div>Applies spacing between elements within a div element for all breakpoints
.flex-startApplies alignment of a flex item to the start<div class="flex flex-start">This item will be aligned to the start</div>Aligns element within a div element to the start for all breakpoints
.flex-centerApplies alignment of a flex item to the center<div class="flex flex-center">This item will be aligned to the center</div>Aligns element within a div element to the center for all breakpoints
.flex-endApplies alignment of flex item to the end<div class="flex flex-end">This item will be aligned to the end</div>Aligns element within a div element to the end for all breakpoints
.flex-topApplies vertical alignment of a flex item to the top<div class="flex flex-top">Items inside will be vertically aligned to the top</div>Aligns elements within a div element to the top for all breakpoints
.flex-middleApplies vertical alignment of a flex item to the middle<div class="flex flex-middle">Items inside will be vertically aligned to the middle</div>Aligns elements within a div element to the middle for all breakpoints
.flex-bottomApplies vertical alignment of a flex item to the bottom<div class="flex flex-bottom">Items inside will be vertically aligned to the bottom</div>Aligns elements within a div element to the bottom for all breakpoints
.flex-wrapApplies flex items to wrap within a flex container<div class="flex flex-wrap">Flex items will wrap within a flex container</div>div elements will wrap within a flex container for all breakpoints
.flex-no-wrapApplies flex items to not wrap within a flex container<div class="flex flex-no-wrap">Flex items will not wrap within a flex container</div>div elements will not wrap within a flex container for all breakpoints
.leftApplies float left<div class="left">This element will float left</div>Applies a float left to a div element for all breakpoints
.rightApplies float right<div class="right">This element will float right</div>Applies a float right to a div element for all breakpoints
.no-margin-mApplies margin 0<div class="no-margin-m">No margin</div>Applies a margin of 0 to a div element for medium devices and above
.no-padding-mApplies padding 0<div class="no-padding-m">No padding</div>Applies a padding of 0 to a div element for medium devices and above
.no-float-mApplies float none<div class="no-float-m">No float</div>Applies a float of none to a div element for medium devices and above
.absolute-mApplies position absolute<div class="absolute-m">Absolute</div>Applies a position of absolute to a div element for medium devices and above
.static-mApplies position static<div class="static-m">Static</div>Applies a position of static to a div element for medium devices and above
.fixed-mApplies position fixed<div class="fixed-m">Fixed</div>Applies a position of fixed to a div element for medium devices and above
.none-mApplies display none<div class="none-m">You won't see this text</div>Applies a display of none to a div element for medium devices and above
.block-mApplies display block<span class="block-m">This will be a block element</span>Applies a display of block to a span element for medium devices and above
.inline-block-mApplies display inline-block<div class="inline-block-m">This element will be inline-block</div>Applies a display of inline-block to a div element for medium devices and above
.inline-mApplies display inline<div class="inline-m">This element will be inline</div>Applies a display of inline to a div element for medium devices and above
.flex-mApplies display flex<div class="flex-m">This element will be flex</div>Applies a display of flex to a div element for medium devices and above
.flex-row-mApplies flex direction row<div class="flex-m flex-row-m">Flex direction will be row</div>Applies a flex direction of flex-row-m to a div element for medium devices and above
.flex-row-reverse-mApplies flex direction row-reverse-m<div class="flex-m flex-row-reverse-m">Flex direction will be row in reverse</div>Applies a flex direction of flex-row-reverse-m to a div element for medium devices and above
.flex-column-mApplies flex direction column<div class="flex-m flex-column-m">Flex direction will be column</div>Applies a flex direction of flex-column-m to a div element for medium devices and above
.flex-column-reverse-mApplies flex direction column-reverse-m<div class="flex-m flex-column-reverse-m">Flex direction will be column reverse</div>Applies a flex direction of flex-column-reverse-m to a div element for medium devices and above
.flex-space-around-mApplies spacing around elements within a flex container<div class="flex-m flex-space-around-m">Flex space around is applied</div>Applies spacing around elements within a div element for medium devices and above
.flex-space-between-mApplies spacing between elements within a flex container<div class="flex-m flex-space-between-m">Flex space between is applied</div>Applies spacing between elements within a div element for medium devices and above
.flex-start-mApplies alignment of a flex item to the start<div class="flex-m flex-start-m">This item will be aligned to the start</div>Aligns element within a div element to the start for medium devices and above
.flex-center-mApplies alignment of a flex item to the center<div class="flex-m flex-center-m">This item will be aligned to the center</div>Aligns element within a div element to the center for medium devices and above
.flex-end-mApplies alignment of flex item to the end<div class="flex-m flex-end-m">This item will be aligned to the end</div>Aligns element within a div element to the end for medium devices and above
.flex-top-mApplies vertical alignment of a flex item to the top<div class="flex flex-top-m">Items inside will be vertically aligned to the top</div>Aligns elements within a div element to the top for medium devices and above
.flex-middle-mApplies vertical alignment of a flex item to the middle<div class="flex flex-middle-m">Items inside will be vertically aligned to the middle</div>Aligns elements within a div element to the middle for medium devices and above
.flex-bottom-mApplies vertical alignment of a flex item to the bottom<div class="flex flex-bottom-m">Items inside will be vertically aligned to the bottom</div>Aligns elements within a div element to the bottom for medium devices and above
.flex-wrap-mApplies flex items to wrap within a flex container<div class="flex-m flex-wrap-m">Flex items will wrap within a flex container</div>div elements will wrap within a flex container for medium devices and above
.flex-no-wrap-mApplies flex items to not wrap within a flex container<div class="flex-m flex-no-wrap-m">Flex items will not wrap within a flex container</div>div elements will not wrap within a flex container for medium devices and above
.left-mApplies float left<div class="left-m">This element will float left</div>Applies a float left to a div element for medium devices and above
.right-mApplies float right<div class="right-m">This element will float right</div>Applies a float right to a div element for medium devices and above
.no-margin-lApplies margin 0<div class="no-margin-l">No margin</div>Applies a margin of 0 to a div element for large devices and above
.no-padding-lApplies padding 0<div class="no-padding-l">No padding</div>Applies a padding of 0 to a div element for large devices and above
.no-float-lApplies float none<div class="no-float-l">No float</div>Applies a float of none to a div element for large devices and above
.absolute-lApplies position absolute<div class="absolute-l">Absolute</div>Applies a position of absolute to a div element for large devices and above
.static-lApplies position static<div class="static-l">Static</div>Applies a position of static to a div element for large devices and above
.fixed-lApplies position fixed<div class="fixed-l">Fixed</div>Applies a position of fixed to a div element for large devices and above
.none-lApplies display none<div class="none-l">You won't see this text</div>Applies a display of none to a div element for large devices and above
.block-lApplies display block<span class="block-l">This will be a block element</span>Applies a display of block to a span element for large devices and above
.inline-block-lApplies display inline-block<div class="inline-block-l">This element will be inline-block</div>Applies a display of inline-block to a div element for large devices and above
.inline-lApplies display inline<div class="inline-l">This element will be inline</div>Applies a display of inline to a div element for large devices and above
.flex-lApplies display flex<div class="flex-l">This element will be flex</div>Applies a display of flex to a div element for large devices and above
.flex-row-lApplies flex direction row<div class="flex-l flex-row-l">Flex direction will be row</div>Applies a flex direction of flex-row-l to a div element for large devices and above
.flex-row-reverse-lApplies flex direction row-reverse-l<div class="flex-l flex-row-reverse-l">Flex direction will be row in reverse</div>Applies a flex direction of flex-row-reverse-l to a div element for large devices and above
.flex-column-lApplies flex direction column<div class="flex-l flex-column-l">Flex direction will be column</div>Applies a flex direction of flex-column-l to a div element for large devices and above
.flex-column-reverse-lApplies flex direction column-reverse-l<div class="flex-l flex-column-reverse-l">Flex direction will be column reverse</div>Applies a flex direction of flex-column-reverse-l to a div element for large devices and above
.flex-space-around-lApplies spacing around elements within a flex container<div class="flex-m flex-space-around-l">Flex space around is applied</div>Applies spacing around elements within a div element for large devices and above
.flex-space-between-lApplies spacing between elements within a flex container<div class="flex-m flex-space-between-l">Flex space between is applied</div>Applies spacing between elements within a div element for large devices and above
.flex-start-lApplies alignment of a flex item to the start<div class="flex-m flex-start-l">This item will be aligned to the start</div>Aligns element within a div element to the start for large devices and above
.flex-center-lApplies alignment of a flex item to the center<div class="flex-m flex-center-l">This item will be aligned to the center</div>Aligns element within a div element to the center for large devices and above
.flex-end-lApplies alignment of flex item to the end<div class="flex-m flex-end-l">This item will be aligned to the end</div>Aligns element within a div element to the end for large devices and above
.flex-top-lApplies vertical alignment of a flex item to the top<div class="flex flex-top-l">Items inside will be vertically aligned to the top</div>Aligns elements within a div element to the top for large devices and above
.flex-middle-lApplies vertical alignment of a flex item to the middle<div class="flex flex-middle-l">Items inside will be vertically aligned to the middle</div>Aligns elements within a div element to the middle for large devices and above
.flex-bottom-lApplies vertical alignment of a flex item to the bottom<div class="flex flex-bottom-l">Items inside will be vertically aligned to the bottom</div>Aligns elements within a div element to the bottom for large devices and above
.flex-wrap-lApplies flex items to wrap within a flex container<div class="flex-m flex-wrap-l">Flex items will wrap within a flex container</div>div elements will wrap within a flex container for large devices and above
.flex-no-wrap-lApplies flex items to not wrap within a flex container<div class="flex-m flex-no-wrap-l">Flex items will not wrap within a flex container</div>div elements will not wrap within a flex container for large devices and above
.left-lApplies float left<div class="left-l">This element will float left</div>Applies a float left to a div element for large devices and above
.right-lApplies float right<div class="right-l">This element will float right</div>Applies a float right to a div element for large devices and above
.no-margin-xlApplies margin 0<div class="no-margin-xl">No margin</div>Applies a margin of 0 to a div element for extra large devices and above
.no-padding-xlApplies padding 0<div class="no-padding-xl">No padding</div>Applies a padding of 0 to a div element for extra large devices and above
.no-float-xlApplies float none<div class="no-float-xl">No float</div>Applies a float of none to a div element for extra large devices and above
.absolute-xlApplies position absolute<div class="absolute-xl">Absolute</div>Applies a position of absolute to a div element for extra large devices and above
.static-xlApplies position static<div class="static-xl">Static</div>Applies a position of static to a div element for extra large devices and above
.fixed-xlApplies position fixed<div class="fixed-xl">Fixed</div>Applies a position of fixed to a div element for extra large devices and above
.none-xlApplies display none<div class="none-xl">You won't see this text</div>Applies a display of none to a div element for extra large devices and above
.block-xlApplies display block<span class="block-xl">This will be a block element</span>Applies a display of block to a span element for extra large devices and above
.inline-block-xlApplies display inline-block<div class="inline-block-xl">This element will be inline-block</div>Applies a display of inline-block to a div element for extra large devices and above
.inline-xlApplies display inline<div class="inline-xl">This element will be inline</div>Applies a display of inline to a div element for extra large devices and above
.flex-xlApplies display flex<div class="flex-xl">This element will be flex</div>Applies a display of flex to a div element for extra large devices and above
.flex-row-xlApplies flex direction row<div class="flex-xl flex-row-xl">Flex direction will be row</div>Applies a flex direction of flex-row-xl to a div element for extra large devices and above
.flex-row-reverse-xlApplies flex direction row-reverse-xl<div class="flex-xl flex-row-reverse-xl">Flex direction will be row in reverse</div>Applies a flex direction of flex-row-reverse-xl to a div element for extra large devices and above
.flex-column-xlApplies flex direction column<div class="flex-xl flex-column-xl">Flex direction will be column</div>Applies a flex direction of flex-column-xl to a div element for extra large devices and above
.flex-column-reverse-xlApplies flex direction column-reverse-xl<div class="flex-xl flex-column-reverse-xl">Flex direction will be column reverse</div>Applies a flex direction of flex-column-reverse-xl to a div element for extra large devices and above
.flex-space-around-xlApplies spacing around elements within a flex container<div class="flex-m flex-space-around-xl">Flex space around is applied</div>Applies spacing around elements within a div element for extra large devices and above
.flex-space-between-xlApplies spacing between elements within a flex container<div class="flex-m flex-space-between-xl">Flex space between is applied</div>Applies spacing between elements within a div element for extra large devices and above
.flex-start-xlApplies alignment of a flex item to the start<div class="flex-m flex-start-xl">This item will be aligned to the start</div>Aligns element within a div element to the start for extra large devices and above
.flex-center-xlApplies alignment of a flex item to the center<div class="flex-m flex-center-xl">This item will be aligned to the center</div>Aligns element within a div element to the center for extra large devices and above
.flex-end-xlApplies alignment of flex item to the end<div class="flex-m flex-end-xl">This item will be aligned to the end</div>Aligns element within a div element to the end for extra large devices and above
.flex-top-xlApplies vertical alignment of a flex item to the top<div class="flex flex-top-xl">Items inside will be vertically aligned to the top</div>Aligns elements within a div element to the top for extra large devices and above
.flex-middle-xlApplies vertical alignment of a flex item to the middle<div class="flex flex-middle-xl">Items inside will be vertically aligned to the middle</div>Aligns elements within a div element to the middle for extra large devices and above
.flex-bottom-xlApplies vertical alignment of a flex item to the bottom<div class="flex flex-bottom-xl">Items inside will be vertically aligned to the bottom</div>Aligns elements within a div element to the bottom for extra large devices and above
.flex-wrap-xlApplies flex items to wrap within a flex container<div class="flex-m flex-wrap-xl">Flex items will wrap within a flex container</div>div elements will wrap within a flex container for extra large devices and above
.flex-no-wrap-xlApplies flex items to not wrap within a flex container<div class="flex-m flex-no-wrap-xl">Flex items will not wrap within a flex container</div>div elements will not wrap within a flex container for extra large devices and above
.left-xlApplies float left<div class="left-xl">This element will float left</div>Applies a float left to a div element for extra large devices and above
.right-xlApplies float right<div class="right-xl">This element will float right</div>Applies a float right to a div element for extra large devices and above

Demo

View page example with the layout helpers stylesheet applied.


Support

  • IE10+ and all other modern browsers.
  • Please specify browsers you need to support in package.json according to browserslist docs.

Authors

Matthew Hartman


License

Code released under the MIT Open Source license.