Yii Framework Forum: [Extension] Yii-Sass - Sass (Scss) And Compass Support - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Extension] Yii-Sass - Sass (Scss) And Compass Support Sass and Compass: compilation, publishing, registration in views

#1 User is offline   Artem Frolov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 14-August 11
  • Location:Russia, Moscow

Posted 17 December 2013 - 01:36 PM

I developed this extension which allows you to use Sass (SCSS) and Compass easily in your Yii projects:
http://www.yiiframew...extension/sass/

Extension can do the following:
  • compile SCSS files on-the-fly
  • publish compiled CSS files
  • register published CSS files


External Sass tools are NOT used, compilation is done using PHP compiler.

This extension caches compiled CSS code and prevents recompilation if there is no need in it.

A few words about Sass and Compass:

Sass is an extension of CSS that adds power and elegance to the basic language. It allows you to use variables, nested rules, mixins, inline imports, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized, and get small stylesheets up and running quickly.

Compass is an open-source CSS authoring framework which uses the Sass stylesheet language to make writing stylesheets powerful and easy.


Feel free to post your thoughts and comments!
0

#2 User is offline   Artem Frolov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 14-August 11
  • Location:Russia, Moscow

Posted 07 February 2014 - 03:38 AM

Version 1.1.0 is released (2014-01-07)
Changes:
  • Allow to register and publish compiled CSS files inside specific published directory to allow using of relative references in CSS for images, fonts and other published files
  • Add compilerOutputFormatting component option, allow to switch between simple, nested and compressed (Pavel Volyntsev)
  • Change default value of the writableDirectoryPermissions component option from 0644 to 0777. It should prevent permission errors on some Linux servers
  • Update code style and documentation


Extension page: http://www.yiiframew...extension/sass/
0

#3 User is offline   Artem Frolov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 14-August 11
  • Location:Russia, Moscow

Posted 12 August 2014 - 08:19 AM

Version 1.2.0 is released (2014-08-12)
Changes:
  • Fix compatibility with the new 0.1 version of the scssphp compiler (alexdevid)
  • Set minimum required PHP version to 5.3 because the new version of scssphp compiler requires it
  • Add new formatting type SassHandler::OUTPUT_FORMATTING_CRUNCHED which can be used with compilerOutputFormatting parameter (alexdevid)
  • Add unit tests to check integration with scssphp compiler and with scssphp-compass library
  • Fix a bug: $hashByName=true argument wasn't properly passed to the Yii's asset manager
  • Minor fixes and improvements


Extension page: http://www.yiiframew...extension/sass/
0

#4 User is offline   Artem Frolov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 14-August 11
  • Location:Russia, Moscow

Posted 21 February 2015 - 11:25 PM

Version 1.3.0 is released (2015-02-21)
Changes:
  • Fix CAssetManager::publish() call - pass $hashByName value used in Yii::app()->sass->publish() and Yii::app()->sass->register() methods
  • Remove deprecated PHPUnit "strict" setting
  • Do not use unstable (dev-master) version of scssphp compiler anymore when Composer is used to install yii-sass extension
  • Make installation via Composer easier - "minimum-stability" setting is not needed anymore
  • Add "writableFilePermissions" option (defaults to 0666), fix file permissions issues with certain umask settings in OS by calling chmod for created/updated files, always call chmod for writable directories
  • Add "defaultHashByName" setting which allows to set a default "$hashByName" value for all plugin's methods
  • Add more information to exceptions' messages
  • Enable Travis CI builds
  • Update documentation


Extension page: http://www.yiiframew...extension/sass/
1

#5 User is offline   Artem Frolov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 14-August 11
  • Location:Russia, Moscow

Posted 01 May 2017 - 03:53 PM

Version 2.0.0 is released (2017-05-01)
Changes:
  • Update scssphp compiler to version ~0.6.7
  • Minimum required PHP version is changed to >= 5.4.0
  • Allow to use custom Yii caching components by configuring "cacheComponentId" option


Extension page: http://www.yiiframew...extension/sass/
0

#6 User is offline   Sarath.U 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 28-June 17

Posted 28 June 2017 - 09:01 PM

how to use

compass watch


Another question, why it always create hex folder without deleting the existing one.

How can I modify the output path folder?
0

#7 User is offline   Artem Frolov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 14-August 11
  • Location:Russia, Moscow

Posted 29 June 2017 - 11:15 AM

Sarath.U, yii-sass doesn't use original compass compiler.
If you want to use compass watch then you should configure your application separately.
But it doesn't make much sense to use both: yii-sass and compass, you probably want to choose one tool.

A new directory is created for new version of files to avoid caching issues.
The output directory is controlled by Yii assetManager, you should configure it accordingly if you want to use another directory.
0

#8 User is offline   technokid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 09-July 17

Posted 09 July 2017 - 07:34 AM

Hi
I have exception when register my scss file

Can not write the compiled CSS file: /home/test/dev.local/gift/assets/front/styles/compiled/core-7f7e5340.css


into my main Controller method init i put this code
 Yii::app()->sass->register(
            Yii::getPathOfAlias('webroot.assets.front.styles') . DIRECTORY_SEPARATOR . 'core.scss'
        );

0

#9 User is offline   Artem Frolov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 14-August 11
  • Location:Russia, Moscow

Posted 11 July 2017 - 10:16 AM

technokid, one of the solutions in your case is to explicitly update directory permissions to allow writing into it
0

#10 User is offline   Artem Frolov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 14-August 11
  • Location:Russia, Moscow

Posted 09 November 2017 - 01:30 PM

Version 2.0.1 is released (2017-11-09)
Changes:
  • #15: Fix an error with the compilation of empty files (tomaszbrunarski)


Extension page: http://www.yiiframew...extension/sass/
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users