summaryrefslogtreecommitdiffstats
path: root/theme-compiler
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-11-23 08:24:11 +0000
committerVaadin Code Review <review@vaadin.com>2012-11-23 08:24:11 +0000
commit1647984d05c5c576c1fe343111c826f3b6c71bc3 (patch)
tree6c17567f186de0f2b72997244c8e62f7174bfc73 /theme-compiler
parent1f62c02e010434ec29f47c2459f57c890c9bba49 (diff)
parentd6caa6043adef61387ccfece57336593641875c4 (diff)
downloadvaadin-framework-1647984d05c5c576c1fe343111c826f3b6c71bc3.tar.gz
vaadin-framework-1647984d05c5c576c1fe343111c826f3b6c71bc3.zip
Merge "Fixes #6714 #10330 - wraps theme in themename{}, creates legacy-styles.css, updates themes to support this."
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)