Some custom media queries shortcuts
$ npm install cssrecipes-custom-media-queries
@import "./node_modules/cssrecipes-custom-media-queries/index.css";
/* for desktop first approch */
@media (--r-maxS) {
/* rules here will be active when viewport will be <= "s" size */
}
/* for mobile first approch */
@media (--r-minS) {
/* rules here will be active when viewport will be > "s" size */
}
Note: your can obviously override the default values of this custom media. Just define the new values after the import.
To generate a build:
$ npm run build
To generate the testing build.
$ npm run build-test
Basic visual tests are in test/index.html
.
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
$ git clone https://github.com/cssrecipes/custom-media-queries.git
$ git checkout -b patch-1
$ npm install
$ npm test