leafo / scssphp

SCSS compiler written in PHP
MIT License
1.34k stars 214 forks source link

Autoprefix? #610

Open jonnybradley opened 6 years ago

jonnybradley commented 6 years ago

Do you or anyone here know of a PHP based autoprefixer, like https://github.com/postcss/autoprefixer.

We use scssphp in Tiki 19 now (for which many thanks!) and it seems we need our prefixes fixing, and it seems like it might be a good option to include in here. The data as to what needs prefixing all seems to be in https://github.com/Fyrd/caniuse - wondering how hard it can be? :)

TIA

nsrosenqvist commented 5 years ago

Also interested in finding a php implementation 👍

padaliyajay commented 5 years ago

Yes I also need autoprefixer for bootstrap 4 in php

arboc commented 5 years ago

autoprefixer would be great... 👍
in the meantime we are using --prefix-free (https://leaverou.github.io/prefixfree/) but a server side solution would be better.

padaliyajay commented 5 years ago

I have tried to make CSS autoprefixer in pure PHP. Take a look and contribute it. https://github.com/padaliyajay/php-autoprefixer

RdeWilde commented 5 years ago

After you run the $compiledCssCode = $compiler->compile($sourceContent), just add the Autoprefixer mentioned by @padaliyajay . $compiledCssCode = (new Autoprefixer($compiledCssCode))->compile(); (import the Autofixer class)

Be sure to add "padaliyajay/php-autoprefixer": "dev-master" to your composer.json`

vuminhluan commented 5 years ago

I have tried to make CSS autoprefixer in pure PHP. Take a look and contribute it. https://github.com/padaliyajay/php-autoprefixer

Sir, I found that autoprefixer removed my comment lines in CSS file. How could i fix it ? (Sorry my English is bad)

Cerdic commented 5 years ago

This is definitely not a feature this compiler should try to deliver.

This is another subject, depending of state of the art of CSS and browser market whereas this compiler is (or try to be) agnostic about CSS keyword, level etc.

Moreover the auto-prefixing is not at all linked to the use of SCSS.

I think we can close this issue.