Skip to content

A simper gradle plugin that compiles and minify sass files

License

Notifications You must be signed in to change notification settings

leobia/SassGradleCompiler

Repository files navigation

Sass Gradle Compiler ⚡

A simple Sass compiler for gradle (tested only on Gradle 6.0+). Given a folder containing .sass and .css files, the plugin will compile them into a single file.

The plugin does not seem to work on a linux environment due to a dependency bug. For an alternative and for more information read here

Instructions 📝

Import the plugin

Import the plugin using one of these:

plugins {
  id "com.leobia.gradle.sassjavacompiler" version "0.2.1"
}

or using legacy plugin app:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.leobia.gradle:sassjavacompiler:0.2.1"
  }
}

apply plugin: "com.leobia.gradle.sassjavacompiler"

Use the plugin

The usage of the plugin it's pretty simple, first you define the options (inside the build.gradle):

sassOptions {  
  inputPath = file("./resources/")   
  outputPath = file("./resources/minified/")
  outputStyle = "compressed"  
  sass = true
  indentWithTabs = false
}
Option Type Description
inputPath* String It telss the plugin where to search input files (not recursive)
outputPath String Directory where output should be saved (will be saved as style.css)
sass Boolean Tells which files should be considered, true -> .sass, false -> .scss
outputStyle String Possible values: nested (default), compressed (minified), compact and expanded

and then you can call the task:

compileSass

Built With 🔨

  • Gradle - Dependency Management
  • jsass - Used to compile sass

Author 👦

Checkout my Gradle JsCompiler

License 📄

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A simper gradle plugin that compiles and minify sass files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages