0.0.1 • Published 6 years ago

postcss-export-custom-media v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

PostCSS Export Custom Media

PostCSS Export Custom Media lets you export custom media queries from CSS to JavaScript by :export selectors.

Installation

$ yarn add postcss-custom-media

or

$ npm install postcss-custom-media

Usage

:root {
  @custom-media --medium (min-width: 1024px);
}

:export {
  _mediumQuery: export-custom-media(--medium);
}

.foo {
  width: 100%;
  @media (--medium) {
    width: 80%;
  }
}

you will get:

:root {
  @custom-media --medium (min-width: 1024px);
}

:export {
  _mediumQuery: (min-width: 1024px);
}

.foo {
  width: 100%;
  @media (--medium) {
    width: 80%;
  }
}