@greyhoundstudio/bp

1.0.0 • Public • Published

@greyhoundstudio/bp

A simple @bp media query mixin for SASS.

Include it in your package with @use:

@use '@greyhoundstudio/bp' as *;

Use it like...

@include bp(sm, md) {
  body {
    font-size: 1.6rem;
  }
}

to generate...

@media only screen and (min-width: 480px) and (max-width: 767px) {
  body {
    font-size: 1.6rem;
  }
}

You can provide just the $min argument, or both $min and $max. You can also provide unit-less values which will be interpreted as pixels, or any other CSS unit.

@include bp(768) {
  body {
    font-size: 1.6rem;
  }
}

@include bp(48rem) {
  body {
    font-size: 1.6rem;
  }
}

You can also configure your own pre-defined breakpoints.

@use '@greyhoundstudio/bp' as * with(
  $breakpoints: (
    "sm": 480px,
    "md": 768px,
    "lg": 1024px
  )
);

Readme

Keywords

Package Sidebar

Install

npm i @greyhoundstudio/bp

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.45 kB

Total Files

4

Last publish

Collaborators

  • tomslominski