A pure Java implementation of the http://sass-lang.com compiler with the target to compile the scss sources of the Bootstrap 5 framework framework.
You can find the project's homepage on GitHub.
No dependencies to other libraries are needed.
repositories {
mavenCentral()
}
dependencies {
implementation 'de.inetsoftware:sass-compiler:+'
}
import com.inet.sass.ScssStylesheet;
import com.inet.sass.handler.SCSSErrorHandler;
import com.inet.sass.resolver.ScssStylesheetResolver;
...
ScssStylesheetResolver resolver = new FilesystemResolver( StandardCharsets.UTF_8 );
SCSSErrorHandler errorHandler = new SCSSErrorHandler() {
...
};
String scssFileName = ...;
ScssStylesheet scss = ScssStylesheet.get( scssFileName, errorHandler, resolver );
scss.compile( ScssContext.UrlMode.ABSOLUTE );
String css = scss.printState();
...
If you want test the latest snapshot then you can checkout or use JitPack.
For example with Gradle:
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.i-net-software:sass-compiler:master-SNAPSHOT'
}