Skip to content

WebMaestroFr/wm-sass-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Sass compiler for WordPress ! This plugin allows you to enqueue .scss styles, edit variables from your dashboard. CSS will be compiled if modifications occured.

It uses the scssphp Compiler.

Installation

  1. Download the last release
  2. Unzip it into your wp-content/plugins directory
  3. Activate the plugin in WordPress

Documentation

Read the documentation

How to use

  • Register and enqueue your Sass sheets the same way you would do for your CSS.

    wp_enqueue_style( 'my-sass-handle', 'http://example.com/css/mystyle.scss', $deps, $ver, $media );
  • Configure the plugin with the sass_configuration filter.

    add_filter( 'sass_configuration', 'my_sass_config' );
    function my_sass_config( $defaults ) {
      return array(
        'variables' => array( 'sass/_variables.scss' ),
        'imports'   => array( 'sass/bootstrap.scss', 'sass/_theme.scss' )
      );
    }

    Configuration of the plugin is optional, but you should at least register your variables if you are using a CSS framework.

  • Set a Sass variable value

    sass_set( $variable, $value );
  • Get a Sass variable value

    sass_get( $variable );

Contributors

Contributors are more than welcome !

License

WTFPL – Do What the Fuck You Want to Public License