Skip to content

codebandits/css-inliner

Repository files navigation

css-inliner

A JVM utility to inline CSS into HTML

Getting Started

I haven't released this on Maven Central yet but you can grab it as a dependency using JitPack.

Gradle Plugin

With HTML templates in src/main/resources/templates/ and a CSS file at src/main/resources/style.css:

// build.gradle

buildscript {
  repositories {
    maven { url 'https://jitpack.io' }
  }
  dependencies {
    // change the commit hash to the latest hash or "master-SNAPSHOT" if you live your life without fear:
    classpath 'com.github.codebandits.css-inliner:com.github.codebandits.css-inliner.gradle.plugin:5301f8a3a1'
  }
}

apply plugin: 'java'
apply plugin: 'com.github.codebandits.css-inliner'

'css-inliner' {
  cssFile = project.file('src/main/resources/style.css')
  filesMatching = ['templates/**/*.html']
}

Just the tool, no plugin

// build.gradle

repositories {
  maven { url 'https://jitpack.io' }
}
dependencies {
  // change the commit hash to the latest hash or "master-SNAPSHOT" if you live your life without fear:
  compile 'com.github.codebandits.css-inliner:css-inliner:5301f8a3a1'
}
// your app

import com.github.codebandits.cssinliner.CssInliner;

// ... ?

About

A JVM utility to inline CSS into HTML

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages