Package com.vaadin.flow.theme
Interface AbstractTheme
- All Superinterfaces:
Serializable
Abstract theme definition class for defining theme variables when in use.
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionThe url for the base component implementation.Return a list of contents to inline to the bootstrap header.getHtmlAttributes(String variant) Gets the attributes that should be set on the<html>element when the Theme variant is applied.The url for the components themed version implementation.default StringtranslateUrl(String url) Translates the givenurlusing the result of thegetThemeUrl()theme method.
-
Method Details
-
getBaseUrl
String getBaseUrl()The url for the base component implementation.e.g. src/
- Returns:
- the base component path
-
getThemeUrl
String getThemeUrl()The url for the components themed version implementation.e.g. theme/lumo/
- Returns:
- the themed component path
-
getHeaderInlineContents
Return a list of contents to inline to the bootstrap header. The contents will be handled as no-wrap as is and will be inserted to the initial page head tag.This will usually be the any
<custom-style>declarations, see CustomStyleFor importing theme files, use
JsModuleon the corresponding theme subclass.- Returns:
- list of string content to inline or empty list if nothing to inline
-
getHtmlAttributes
Gets the attributes that should be set on the<html>element when the Theme variant is applied.- Parameters:
variant- the variant defined in theThemeannotation, notnull- Returns:
- a Map with the attributes (keys and values) that should be set in the body, or an empty Map if nothing should be set for the given variant.
-
translateUrl
Translates the givenurlusing the result of thegetThemeUrl()theme method.If translation is possible then translated URL is returned. Otherwise the
urlis returned.- Parameters:
url- the URL to translate using the theme- Returns:
- translated URL if possible or the same given
urlif not.
-