csstools / precss

Use Sass-like markup in your CSS
https://jonathantneal.github.io/precss/
Creative Commons Zero v1.0 Universal
1.61k stars 77 forks source link

Does this plugin support percentage($number) as SASS does? #76

Open gfdesign opened 8 years ago

gfdesign commented 8 years ago

I am moving some .scss files to PostCSS but I came across with this rule:

.article {
  width: percentage(1/2); 
}

With this method http://sass-lang.com/documentation/Sass/Script/Functions.html#percentage-instance_method, we able to get this:

.article {
  width: 50%; 
}

I wondering if it possible to do that with your plugin? Regards

creeperyang commented 7 years ago

Any further info?

diverent2 commented 5 years ago

Hey there,

currently this isn´t an feature of precss. However there is also a postcss plugin for that called postcss-number-functions.

IMO this potentially could get added to precss since it tries to emulate a lot of the sass features. Until then you can just add this plugin to your postcss-plugin list :)

(Note: your plugins will be executed from bottom to top, might help if you run into issues)