summaryrefslogtreecommitdiffstats
path: root/theme-compiler
diff options
context:
space:
mode:
authorMarc Englund <marc@vaadin.com>2012-11-22 17:09:10 +0200
committerMarc Englund <marc@vaadin.com>2012-11-23 09:29:59 +0200
commitd6caa6043adef61387ccfece57336593641875c4 (patch)
tree64ad544c320a07b1ce7394cd06ecbb2c637a6abd /theme-compiler
parente33302b9676ae62ea0bdc53ff6c6e3f4aea01522 (diff)
downloadvaadin-framework-d6caa6043adef61387ccfece57336593641875c4.tar.gz
vaadin-framework-d6caa6043adef61387ccfece57336593641875c4.zip
Fixes #6714 #10330 - wraps theme in themename{}, creates legacy-styles.css, updates themes to support this.
Change-Id: I185b67b2ee74dca2faf48ff2517f24280aff4375
Diffstat (limited to 'theme-compiler')
-rw-r--r--theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java31
1 files changed, 24 insertions, 7 deletions
diff --git a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java
index 47c519d09e..afef575a7f 100644
--- a/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java
+++ b/theme-compiler/src/com/vaadin/buildhelpers/CompileTheme.java
@@ -45,17 +45,31 @@ public class CompileTheme {
String themeFolder = params.getOptionValue("theme-folder");
String themeVersion = params.getOptionValue("theme-version");
+ // Regular theme
try {
- processSassTheme(themeFolder, themeName, themeVersion);
- System.out.println("Compiling theme " + themeName + " successful");
+ processSassTheme(themeFolder, themeName, "styles", themeVersion);
+ System.out.println("Compiling theme " + themeName
+ + " styles successful");
} catch (Exception e) {
- System.err.println("Compiling theme " + themeName + " failed");
+ System.err.println("Compiling theme " + themeName
+ + " styles failed");
+ e.printStackTrace();
+ }
+ // Legacy theme w/o .themename{} wrapping
+ try {
+ processSassTheme(themeFolder, themeName, "legacy-styles",
+ themeVersion);
+ System.out.println("Compiling theme " + themeName
+ + " legacy-styles successful");
+ } catch (Exception e) {
+ System.err.println("Compiling theme " + themeName
+ + " legacy-styles failed");
e.printStackTrace();
}
}
private static void processSassTheme(String themeFolder, String themeName,
- String version) throws Exception {
+ String variant, String version) throws Exception {
StringBuffer cssHeader = new StringBuffer();
@@ -66,10 +80,12 @@ public class CompileTheme {
String stylesCssDir = themeFolder + File.separator + themeName
+ File.separator;
- String stylesCssName = stylesCssDir + "styles.css";
+
+ String stylesCssName = stylesCssDir + variant + ".css";
// Process as SASS file
- String sassFile = stylesCssDir + "styles.scss";
+ String sassFile = stylesCssDir + variant + ".scss";
+
ScssStylesheet scss = ScssStylesheet.get(sassFile);
if (scss == null) {
throw new IllegalArgumentException("SASS file: " + sassFile
@@ -87,7 +103,7 @@ public class CompileTheme {
createSprites(themeFolder, themeName);
File oldCss = new File(stylesCssName);
- File newCss = new File(stylesCssDir + "styles-sprite.css");
+ File newCss = new File(stylesCssDir + variant + "-sprite.css");
if (newCss.exists()) {
// Theme contained sprites. Renamed "styles-sprite.css" ->
@@ -100,6 +116,7 @@ public class CompileTheme {
+ " failed");
}
}
+
}
private static void createSprites(String themeFolder, String themeName)