cuth / postcss-pxtorem

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

Avoid needing to declare each side of the box model #1

Open simonsmith opened 9 years ago

simonsmith commented 9 years ago

Great plugin, very useful.

However with properties like margin, padding etc it would be great to use just margin and it cover off margin-top, margin-bottom etc without declaring them all. It gets quite verbose when you add padding in there too.

cuth commented 9 years ago

That's a good point. Thanks for the idea. I think that can be done.

cuth commented 9 years ago

It might be a little while before I get to this. For now, maybe hide the white list in a separate file.

// postcss-pxtorem white list
module.exports = [
  'font',
  'font-size',
  'line-height',
  'letter-spacing',
  'margin',
  'margin-top',
  'margin-right',
  'margin-bottom',
  'margin-left',
  'padding',
  'padding-top',
  'padding-right',
  'padding-bottom',
  'padding-left'
];
simonsmith commented 9 years ago

Sure, it's not a big problem. Just a nice to have