summaryrefslogtreecommitdiffstats
path: root/theme-compiler
diff options
context:
space:
mode:
authorMarc Englund <marc@vaadin.com>2012-10-04 14:38:41 +0300
committerMarc Englund <marc@vaadin.com>2012-10-04 14:38:41 +0300
commita32395355d89c16449f051bb9fb57da30cb4f3ce (patch)
treef1263321b2f4555906e9937e68c6257c72b0384f /theme-compiler
parent0f5606dace38d575efcd2e0109390b34aebb05d3 (diff)
downloadvaadin-framework-a32395355d89c16449f051bb9fb57da30cb4f3ce.tar.gz
vaadin-framework-a32395355d89c16449f051bb9fb57da30cb4f3ce.zip
FontFace nodes are created correctly, fixes #9611 (author: seba)
Change-Id: Ifbec8e848654c19e95c19cce05976ed9e5d8290a
Diffstat (limited to 'theme-compiler')
-rw-r--r--theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java7
-rw-r--r--theme-compiler/src/com/vaadin/sass/tree/FontFaceNode.java18
2 files changed, 23 insertions, 2 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java b/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java
index f9778af419..a0e9db7551 100644
--- a/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java
+++ b/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java
@@ -31,6 +31,7 @@ import com.vaadin.sass.parser.LexicalUnitImpl;
import com.vaadin.sass.tree.BlockNode;
import com.vaadin.sass.tree.CommentNode;
import com.vaadin.sass.tree.ExtendNode;
+import com.vaadin.sass.tree.FontFaceNode;
import com.vaadin.sass.tree.ForNode;
import com.vaadin.sass.tree.ImportNode;
import com.vaadin.sass.tree.ListRemoveNode;
@@ -171,12 +172,14 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler {
@Override
public void startFontFace() throws CSSException {
- System.out.println("startFontFace()");
+ FontFaceNode node = new FontFaceNode();
+ nodeStack.peek().appendChild(node);
+ nodeStack.push(node);
}
@Override
public void endFontFace() throws CSSException {
- System.out.println("endFontFace()");
+ nodeStack.pop();
}
@Override
diff --git a/theme-compiler/src/com/vaadin/sass/tree/FontFaceNode.java b/theme-compiler/src/com/vaadin/sass/tree/FontFaceNode.java
new file mode 100644
index 0000000000..3dab4df773
--- /dev/null
+++ b/theme-compiler/src/com/vaadin/sass/tree/FontFaceNode.java
@@ -0,0 +1,18 @@
+package com.vaadin.sass.tree;
+
+public class FontFaceNode extends Node {
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("@font-face {\n");
+
+ for (final Node child : children) {
+ builder.append("\t" + child.toString() + "\n");
+ }
+
+ builder.append("}");
+ return builder.toString();
+ }
+
+}