liferay / liferay-theme-tasks

A set of tasks for building and deploying Liferay Portal themes.
18 stars 24 forks source link

use autoprefixer for css and sass #81

Closed marcelmokos closed 6 years ago

marcelmokos commented 6 years ago

Is there a plan to add autoprefixer for css and sass in the project? If not are you accepting PR's?

https://github.com/postcss/autoprefixer#gulp

jbalsas commented 6 years ago

Hey @marcelmokos, we don't have any plans for that at this moment, but the project has a lot of extension points to allow you to use that.

You can find some examples by @marcoscv-work on how to generate svg sprites and how to use postcss in your themes.

We have some documentation drafts for this on the queue.

I think we'd rather keep the project smaller and extensible, but if you think those hook mechanisms don't provide all you need, we will be more than happy to discuss it and review/accept contributions :)

marcelmokos commented 6 years ago

I feel like the autoprefixer should be used nowdays as default. It is standard to use this tool for last 5 years.

Thanks, for example, I will try to use https://github.com/marcoscv-work/styled-postcss-theme solution with a hook.

marcelmokos commented 6 years ago

I had to change the proposed code from examples to be able to finish build of the theme. I have opened PR's to repair this behavior for proposed examples as well.

https://github.com/marcoscv-work/styled-postcss-theme/pull/1 https://github.com/marcoscv-work/styled-svg-sprite-theme/pull/2

quodos commented 6 years ago

You can use autoprefixer via gulp. Have a look at our solution here: https://github.com/dccs-liferay/liferay-theme-autoprefixer

kino90 commented 6 years ago

I agree with @marcelmokos. It's unlikely to have a gulp/webpack setup in 2018 without the need of autoprefixer, expecially when you have to support older MSIE versions (like 95% of the times).

I ended up using the hook above, but it would be better to have a prefix-less base css that gets prefixes automatically at build time (so that can also be upgraded easily when some prefixes won't be needed anymore)

jbalsas commented 6 years ago

Hey @kino90, @marcelmokos, I've filed https://github.com/liferay/liferay-themes-sdk/issues/46 to followup with this so we can analyze how to add support for PostCSS to the tooling out of the box. Please, feel free to add any additional feedback there!