at-rules

mixins

media-breakpoint-up

Since 0.1.0
@mixin media-breakpoint-up($name, $breakpoints) { ... }

Description

Media of at least the minimum breakpoint width. No query for the smallest breakpoint.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

the name for the breakpoint

String none
$breakpoints

a map of grid breakpoints

Map none

Example

.test {
  @include media-breakpoint-up('md') {
    width: 25%;
  }
}

Used by

Author

  • Mark Otto

media-breakpoint-down

Since 0.1.0
@mixin media-breakpoint-down($name, $breakpoints) { ... }

Description

Media of at most the maximum breakpoint width. No query for the largest breakpoint.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

the name for the breakpoint

String none
$breakpoints

a map of grid breakpoints

Map none

Example

.test {
  @include media-breakpoint-down('md') {
    width: 100%;
  }
}

Used by

Author

  • Mark Otto

media-breakpoint-between

Since 0.1.0
@mixin media-breakpoint-between($lower, $upper, $breakpoints) { ... }

Description

Media that spans multiple breakpoint widths. Makes the @content apply between the min and max breakpoints

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$lower

the name for the lower/min breakpoint

String none
$upper

the name for the upper/max breakpoint

String none
$breakpoints

a map of grid breakpoints

Map none

Example

.test {
  @include media-breakpoint-between('md', 'xl') {
    width: 50%;
  }
}

Requires

Author

  • Mark Otto

media-breakpoint-only

Since 0.1.0
@mixin media-breakpoint-only($name, $breakpoints) { ... }

Description

Media between the breakpoint's minimum and maximum widths. No minimum for the smallest breakpoint, and no maximum for the largest one.

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$name

the name for the breakpoint

String none
$breakpoints

a map of grid breakpoints

Map none

Example

.test {
  @include media-breakpoint-only('md', $breakpoints) {
    width: 50%;
  }
}

Requires

Author

  • Mark Otto

backgrounds & borders

mixins

background-color

Since 0.1.0
@mixin background-color($parent, $bgcolor, $color, $alt-color: rgb(255, 255, 255)) { ... }

Description

Creates background color variants

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$parent

a CSS selector; should not include an HTML element

String none
$bgcolor

the background color; will check the contrast with the $color

Color none
$color

the text color

Color none
$alt-color

a fallback color if for if the $color provided fails A11Y check

Colorrgb(255, 255, 255)

Example

.example {
  @include bg-color-variant('.bg-test', black, white);
}

Requires

border-radius

Since 0.1.0
@mixin border-radius($radius) { ... }

Description

Creates border-radius

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$radius

a valid CSS unit to create a border-radius on all sides

Number none

Example

.example {
  @include border-radius();
}

Author

  • Mark Otto

border-top-radius

Since 0.1.0
@mixin border-top-radius($radius) { ... }

Description

Creates border-top-radius

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$radius

a valid CSS unit to create a border-radius on the top

Number none

Example

.example {
  @include border-top-radius(2px);
}

Author

  • Mark Otto

border-right-radius

Since 0.1.0
@mixin border-right-radius($radius) { ... }

Description

Creates border-right-radius

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$radius

a valid CSS unit to create a border-radius on the right

Number none

Example

.example {
  @include border-right-radius(2px);
}

Author

  • Mark Otto

border-bottom-radius

Since 0.1.0
@mixin border-bottom-radius($radius) { ... }

Description

Creates border-bottom-radius

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$radius

a valid CSS unit to create a border-radius on the bottom

Number none

Example

.example {
  @include border-bottom-radius(2px);
}

Author

  • Mark Otto

border-left-radius

Since 0.1.0
@mixin border-left-radius($radius) { ... }

Description

Creates border-left-radius

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$radius

a valid CSS unit to create a border-radius on the left

Number none

Example

.example {
  @include border-left-radius(2px);
}

Author

  • Mark Otto

border

Since 0.1.0
@mixin border($direction: null, $color: inherit, $style: solid, $width: .0625rem) { ... }

Description

Creates border variants

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$direction

either bottom, left, top, or right; if you don't provide then it defaults to all sides

Stringnull
$color

a valid CSS color

Colorinherit
$style

a valid border style

Stringsolid
$width

a valid number

Number.0625rem

Example

.example {
  @include border(right, red, solid, 2px);
}

positioning

mixins

center

Since 0.1.0
@mixin center($position: null) { ... }

Description

Centers a element absolutely on any or multiple planes

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$position

The position or plane to center

Stringnull

Example

.example {
  @include center();
}

Author

  • Mark Otto

pseudo-classes

mixins

hover

Since 0.1.0
@mixin hover() { ... }

Description

Creates hover mixin

Parameters

None.

Example

.test {
  @include hover {
    text-decoration: underline;
  }
}

Author

  • Mark Otto

hover-focus

Since 0.1.0
@mixin hover-focus() { ... }

Description

Creates hover, focus combo mixin

Parameters

None.

Example

.test {
  @include hover-focus {
    text-decoration: underline;
    outline: 1px solid blue;
  }
}

Used by

Author

  • Mark Otto

plain-hover-focus

Since 0.1.0
@mixin plain-hover-focus() { ... }

Description

Creates hover, focus and parent combo mixin

Parameters

None.

Example

.test {
  @include plain-hover-focus {
    background-color: blue;
  }
}

Author

  • Mark Otto

hover-focus-active

Since 0.1.0
@mixin hover-focus-active() { ... }

Description

Creates hover, focus, and active combo mixin

Parameters

None.

Example

.test {
  @include hover-focus-active {
    background-color: blue;
  }
}

Author

  • Mark Otto

has-nth

Since 0.1.0
@mixin has-nth($expression, $element: '*') { ... }

Description

Creates has-nth

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$expression

a valid CSS expression

String none
$element

a valid CSS selector

String'*'

Example

li {
   @include has-nth('n + 4', 'li') {
      color: blue;
   }
}

Used by

Author

  • Adam Giese

at-least

Since 0.1.0
@mixin at-least($quantity, $element: '*') { ... }

Description

Creates at-least

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$quantity

a number of items to narrow

Number none
$element

a valid CSS selector

String'*'

Example

li {
   @include at-least(4, 'li') {
      color: blue;
   }
}

Requires

Author

  • Adam Giese

at-most

Since 0.1.0
@mixin at-most($quantity, $element: '*') { ... }

Description

Creates at-most

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$quantity

a number of items to narrow

Number none
$element

a valid CSS selector

String'*'

Example

li {
   @include at-most(4, 'li') {
      color: blue;
   }
}

Requires

Author

  • Adam Giese

divisible-by

Since 0.1.0
@mixin divisible-by($quantity, $offset: 0, $element: '*') { ... }

Description

Creates divisible-by

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$quantity

a number of items to narrow

Number none
$offset

a number to add on to narrow

Number0
$element

a valid CSS selector

String'*'

Example

li {
   @include divisible-by(4, 0, 'li') {
      color: blue;
   }
}

Requires

Author

  • Adam Giese

has-exactly

Since 0.1.0
@mixin has-exactly($quantity, $element: '*') { ... }

Description

Creates has-exactly

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$quantity

a number of items to narrow

Number none
$element

a valid CSS selector

String'*'

Example

li {
   @include has-exactly(4, 'li') {
      color: blue;
   }
}

Requires

Author

  • Adam Giese

has-odd

Since 0.1.0
@mixin has-odd($element: '*') { ... }

Description

Creates has-odd

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$element

a valid CSS selector

String'*'

Example

li {
   @include has-odd('li') {
      color: blue;
   }
}

Requires

Author

  • Adam Giese

has-even

Since 0.1.0
@mixin has-even($element: '*') { ... }

Description

Creates has-even

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$element

a valid CSS selector

String'*'

Example

li {
   @include has-even('li') {
      color: blue;
   }
}

Requires

Author

  • Adam Giese

text

mixins

text-color

Since 0.1.0
@mixin text-color($parent, $color) { ... }

Description

Creates text color variants

Parameters

parameter Nameparameter Descriptionparameter Typeparameter Default value
$parent

a CSS selector; should not include an HTML element

String none
$color

the text color

Color none

Example

.example {
  @include text-color('.text-test', black, white);
}

Requires