From a4fbf0a60ca9ec83346d403c569dc7c6db91b87f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 15 Nov 2012 13:51:14 +0200 Subject: [PATCH] Use classloader also to find theme styles.scss (#10107) Change-Id: I4fb5790dc23e8c5cedfc2113158181abf646245e --- server/src/com/vaadin/server/VaadinServlet.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index 2ef9550823..23378e4c20 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -936,6 +936,17 @@ public class VaadinServlet extends HttpServlet implements Constants { } String realFilename = sc.getRealPath(scssFilename); ScssStylesheet scss = ScssStylesheet.get(realFilename); + if (scss == null) { + // Not a file in the file system (WebContent directory). Use the + // identifier directly (VAADIN/themes/.../styles.css) so + // ScssStylesheet will try using the class loader. + if (scssFilename.startsWith("/")) { + scssFilename = scssFilename.substring(1); + } + + scss = ScssStylesheet.get(scssFilename); + } + if (scss == null) { getLogger() .warning( -- 2.39.5