5.2.0 • Published 7 years ago

am-strap v5.2.0

Weekly downloads
8
License
MIT
Repository
-
Last release
7 years ago

AM Strap

A DRY and modular grid framework built with SCSS using attribute modules and flexbox.

Why AM Strap? Many class based grids involve repetition and result in long and unreadable chains of classes. Splitting the values into attribute modules (AM) produces shorter and more semantic markup with the same visual results.

Install

npm install am-strap

Import am-strap.scss at the beginning of your stylesheet.

Config

To customise the grid, add the config map before importing AM Strap.

To use floats instead of flexbox, set grid-type to float.

$am-strap: (
  "columns": 12,
  "grid-type": "flexbox",
  "breakpoints": (
    "xs": (
      "breakpoint": 0px,
      "column-padding": 1rem,
      "container-padding": 1rem,
      "container-max-width": false
    ),
    "sm": (
      "breakpoint": 420px,
      "column-padding": 1rem,
      "container-padding": 1rem,
      "container-max-width": false
    ),
    "md": (
      "breakpoint": 768px,
      "column-padding": 1rem,
      "container-padding": 1rem,
      "container-max-width": true
    ),
    "lg": (
      "breakpoint": 992px,
      "column-padding": 1rem,
      "container-padding": 1rem,
      "container-max-width": true
    ),
    "xl": (
      "breakpoint": 1200px,
      "column-padding": 1rem,
      "container-padding": 1rem,
      "container-max-width": true
    )
  )
);

HTML Usage

Container with row and columns

<div am-container>
  <div am-row>
    <div am-col="md-4 xs-6"></div>
    <div am-col="md-4 xs-3"></div>
    <div am-col="md-4 xs-3"></div>
  </div>
</div>

Push and pull columns

<div am-col="sm-6" am-push="sm-6"></div>
<div am-col="sm-6" am-pull="sm-6"></div>

Offet columns

<div am-col="md-6" am-offset="md-3"></div>
<div am-col="lg-3" am-offset="lg-1"></div>

Hide and show elements

<div am-col="md-6" am-hidden="xs sm"></div>
<div am-col="xs-9" am-visible="xs sm"></div>

CSS Usage

Target a specific breakpoint

@media #{$only-sm} {
  // Styles...
}

Target above a breakpoint

@media #{$above-md} {
  // Styles...
}

Target below a breakpoint

@media #{$below-lg} {
  // Styles...
}
5.2.0

7 years ago

5.1.0

7 years ago

5.0.1

7 years ago

5.0.0

7 years ago

4.3.0

7 years ago

4.2.0

7 years ago

2.0.0

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago