Skip to content

A GWT resource generator implementation for using sass files as client resources.

Notifications You must be signed in to change notification settings

TwoStone/gwt-scss-resource

Repository files navigation

gwt-scss-resource

Download Build Status

The gwt-scss-resource is a GWT resource implementation for using SASS/SCSS files as resources in GWT ClientBundles.

Basic usage

For using the scss resource in your gwt project you have to do the following steps:

  • add the gwt-scss-resource jar to your gwt classpath. When you use a build tools with depenedencies management you can get it from jcenter

Maven:

<dependency>
  <groupId>com.nwalter.gwt</groupId>
  <artifactId>gwt-scss-resource</artifactId>
  <version>1.2.0</version>
  <type>pom</type>
</dependency>

Gradle:

dependencies {
    compile 'com.nwalter.gwt:gwt-scss-resource:1.2.0'   
}
  • add the gwt-scss-resource-module to your module xml
<module>
  ...
  <inherits name="com.nwalter.gwt.scss.ScssResource" />
  ...
</module>
  • use the ScssResource interface in your client bundle
public interface MyClientBundle extends ClientBundle {
	
  ScssResource myStyle();
  
}

Advanced

Minify

You can enable the minification of the resulting css by setting the configuration property scss.minify to true

Example:

<module>
  ...
  <inherits name="com.nwalter.gwt.scss.ScssResource" />

  <set-configuration-property name="scss.minify" value="true"/>
  ...
</module>

Include paths

For resolving @import statements in your sass files the compiler will look in the directory of the sass file and on the classpath of the gwt-compiler. If you want to add additional paths to lookup imports you can add this by annotating the resource method in your client bundle.

Example:

public interface MyClientBundle extends ClientBundle {
	
  @IncludePaths({
    "resources/vendor/bootstrap",
    "resources/vendor/ui"
  })
  @Source("style.scss")
  ScssResource myStyle();
  
}

About

A GWT resource generator implementation for using sass files as client resources.

Resources

Stars

Watchers

Forks

Packages

No packages published