Skip to content

Integrate Sass compiler#17

Merged
gsuez merged 1 commit into
gsuez:masterfrom
phproberto:sass-compiler
Apr 2, 2016
Merged

Integrate Sass compiler#17
gsuez merged 1 commit into
gsuez:masterfrom
phproberto:sass-compiler

Conversation

@phproberto

Copy link
Copy Markdown
Contributor

Description

This integrates a Sass compiler so users can compile files on the fly online. I think compiling files that way is never recommended but I understand that it can help some users.

Main features

  • Sass compilation can be enabled/disabled form a backend setting
  • System automatically detects files that need to be updated/refreshes. So when the Sass files are not changed page loading time won't be affected.
  • Based on leafo/scss library which is the strongest sass compiler nowadays.
  • System supports an optional _custom.css that users can create to add their own logic with Sass. That file won't be replaced by updates so it's safe to modify.

How to test

  • Install the template on a Joomla website
  • Go to template parameters and set to Yes a new parameter called Compile Sass
  • Load frontend and check that a message is shown with the Sass compilation information. I left that message explicitly so nobody forgets to disable Sass compiling when editing sass files is finished.
  • Create/edit templates/masterbootstrap/scss/template/_custom.scss to add some custom CSS rules there.
  • Reload page and see that Sass files are compiled and CSS styles applied.
  • Reload page again without modifying any scss file to test that cache check works.

Extra notes

  • I haven't gitignored composer libraries because it will be useful for you to test them if you are not familiar with composer. So this works 100% independently without requiring you to do anything. The right way would be to gitignore them and only execute composer install when you are releasing a new version of the template.
  • The library Phproberto\Sass\FileCompiler it's going to be moved to its own repo but that will only require you to change composer.json file. I will contribute that change when I publish it on packagist.
  • Originally I had added bootstrap sass files because I think is always better to load a unique css file with bootstrap + template settings there. I removed it because it could conflict with your current system that uses different bootstrap files for different styles. But if you think that having everything compiled into the same file I will be happy to do it.

@gsuez gsuez merged commit b96ce51 into gsuez:master Apr 2, 2016
@phproberto phproberto deleted the sass-compiler branch April 11, 2016 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants