cuth / postcss-pxtorem

Convert pixel units to rem (root em) units using PostCSS
MIT License
2.06k stars 172 forks source link

option to skip border: 1px #17

Closed sylvainbaronnet closed 8 years ago

sylvainbaronnet commented 8 years ago

hello,

border with 1px tend to disappear using rem for responsive. I would like an option to avoid converting border values if the value is 1px. Something like border-safe ?

I made a quick change locally for one project, it seems to work but i'm sure it can be better... line 33:

if(decl.prop === 'border' || decl.prop === 'border-top' || decl.prop === 'border-bottom' || decl.prop === 'border-left' || decl.prop === 'border-right')
{
    if(value.indexOf('1px') >= 0 && value.indexOf('11px') == -1)
    {
        return;
    }
}
sylvainbaronnet commented 8 years ago

I forgot border-width and border-top-width, etc in the exemple

hzlzh commented 8 years ago

check here https://github.com/cuth/postcss-pxtorem/pull/18

cuth commented 8 years ago

11f04b09d3616f85f6705567fd30b70e37c9aa7d