Skip to content

Rendalf/postcss-export-custom-media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostCSS Export Custom Media PostCSS Logo

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%;
  }
}

About

Export css custom media

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published