How to use Stylelint to prevent use of "max-width" in media queries -


i'd warn/error when using max-width in media queries , encourage mobile-first approach min-width.

can warn/error on...

@media (max-width: 50em) {   padding: 1rem; } 

but allow...

@media (min-width: 50em) {   padding: 1rem; } 

the media-feature-name-blacklist , media-feature-name-whitelist rules can used in latest stylelint:

"media-feature-name-blacklist": [   "^max-width",     {       "message": "use min-width mobile-first approach (media-feature-name-blacklist)",     },   ], }, 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -