evrone / postcss-px-to-viewport

A plugin for PostCSS that generates viewport units (vw, vh, vmin, vmax) from pixel units. The best choice to create a scalable interface on different displays by one design size.
https://evrone.com/postcss-px-viewport
MIT License
3k stars 405 forks source link

support to ignore comments eg. /*no*/ /*px*/ #27

Closed lcat closed 4 years ago

lcat commented 5 years ago

Sometimes selectorBlackList is not easy to use.

example:

// before - add selectorBlackList ['ignore']
.box {
    width: 10px;
    height: 10px;
}
.box.ignore {
    border: solid 1px #ddd;
}

// now - with comments
.box {
    width: 10px;
    height: 10px;
    border: solid 1px #ddd; /*no*/
}
KODerFunk commented 5 years ago

@lcat hi! no and px is too common words. Also need test.

lcat commented 5 years ago

@KODerFunk hei~ Test cases have been added, no and px is a reference https://github.com/songsiqi/px2rem

KODerFunk commented 5 years ago

@lcat hei! Tests are good! But I still worry about the correct expected result of the plugin. First, no and px are too simple common words. Secondly, we just need to be able to work without conflicts with other postcss-plugins.

Prease, 1) replace no and px to postcss-px-to-viewport-ignore 2) describe postcss-px-to-viewport-ignore comment directive in example in README.md and README_CN.md

likun7981 commented 4 years ago

@lcat Hi guys, when are you planning to have this merged?

KODerFunk commented 4 years ago

@likun7981 This is a good feature! I’ll try to find the time this month to complete and release the update, but I need a translation for the readme before release, I will call you there later.

hsxfjames commented 4 years ago

@KODerFunk Hi, how is it going now?

And, how about the comments like px-to-viewport-disable or px-to-viewport-ignore? Shorter without postcss- prefix.

KODerFunk commented 4 years ago

@hsxfjames good idea with naming. I working on this feature by correct post-css api. The next release of these days.

KODerFunk commented 4 years ago

https://github.com/evrone/postcss-px-to-viewport/commit/9d6c5cee5eea367fb4c7cf0c3bb1117979b5fbf4

Read more about ignoring.

需要翻译帮助。