com.vaadin.flow.server.frontend.
Class CssBundler
Utility methods to handle application theme CSS content.
For internal use only. May be renamed or removed in a future release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
inlineImports
(File themeFolder, File cssFile) Deprecated.
static String
inlineImports
(File themeFolder, File cssFile, elemental.json.JsonObject themeJson) Recurse over CSS import and inlines all ot them into a single CSS block.
-
Constructor Details
-
CssBundler
public CssBundler()
-
-
Method Details
-
inlineImports
Deprecated.this method does not resolve theme assets, useinlineImports(File, File, JsonObject)
instead.Recurse over CSS import and inlines all ot them into a single CSS block.
@import
statements must come before any other CSS instruction, otherwise the import is ignored by the browser.url('image.png')
referencing theme resources rewritten to be correctly served by Vaadin at runtime.Parameters:
themeFolder
- location of theme folder on the filesystem.cssFile
- the CSS file to process.Returns:
the processed stylesheet content, with inlined imports and rewritten URLs.
Throws:
IOException
- if filesystem resources can not be read. -
inlineImports
public static String inlineImports(File themeFolder, File cssFile, elemental.json.JsonObject themeJson) throws IOException Recurse over CSS import and inlines all ot them into a single CSS block.
@import
statements must come before any other CSS instruction, otherwise the import is ignored by the browser.url('image.png')
referencing theme resources or assets are rewritten to be correctly served by Vaadin at runtime.Parameters:
themeFolder
- location of theme folder on the filesystem.cssFile
- the CSS file to process.themeJson
- the theme configuration, usually stored in theme.json file.Returns:
the processed stylesheet content, with inlined imports and rewritten URLs.
Throws:
IOException
- if filesystem resources can not be read.
-
inlineImports(File, File, JsonObject)
instead.