liferay / liferay-theme-tasks

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

Support 7-mode compilation for 6.2 themes #14

Closed yuchi closed 8 years ago

yuchi commented 8 years ago

Currently those choices are locked together:

While Compass requires ruby-sass, the way the theme is compiled should not be tied to that choice.

I’ll make a PR with minor hack-ish changes that let me compile 6.2 themes in the 7’s fashion, but I’d like to discuss this issue deeper.

robframpton commented 8 years ago

Hey @yuchi

Thanks for the pr. There are changes related to this which I've been wanting to implement but haven't had the time.

What I'm planning to do, is remove the supportCompass option altogether from the themeConfig, and just have a "rubySass" option, which will automatically be set to true for 6.2, and false for 7.0.

If you are on 6.2 and want to use libSass, you would manually set rubySass to false and add gulp-sass as a dependency to your theme. If you are on 7.0 and want rubySass you'd set it to true and add gulp-ruby-sass as a dependency.

There is also a way to hook into the compile-css task and use whatever preprocessor/file extension you want, it's not very well implemented/documented at the moment, but I'm planning on making it more robust with these rubySass changes.

These changes won't be published for a little while, as I'll be out of the office until Monday, but I just wanted to let you know what the plans were.

yuchi commented 8 years ago
  1. Great!
  2. Go on, if you merge this small one I can use my workaround in the meanwhile
  3. I have some crazy ideas to solve this kind of issues altogether that I'd like to share with you but they are pretty invasive so don't make this stop you
  4. I saw that custom preprocessor stuff but avoided it :)
robframpton commented 8 years ago

Not sure why that got closed.

In regards to point 3, I like crazy ideas, so please feel free to share :)

robframpton commented 8 years ago

With release 1.0.4, 6.2 themes can be built using libSass. You'll just need to set the theme's liferayThemes.rubySass property to false in the package.json and install gulp-sass as a dev-dependency of your theme (npm i --save-dev gulp-sass).

6.2 themes will still use compass instead of bourbon, since that is a dependency of 6.2 base themes. However, instead of using your system's native compass gem, it will use the compass-mixins module.