You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/upgrading/index.adoc
+8-19Lines changed: 8 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -233,28 +233,17 @@ Below are the main highlights of the changes and more detailed instructions are
233
233
234
234
The special `frontend/themes` folder, and the `components` sub-folder for CSS shadow-DOM injection, is deprecated (but still supported).
235
235
236
-
Injecting CSS into Vaadin components’ shadow DOM through the components sub-folder in your `frontend/themes/<mytheme>` folder is disabled by default. Shadow DOM styling is no longer recommended (as of V24), but if you still need to use it, it can be enabled with the feature flag `themeComponentStyles`.
236
+
Injecting CSS into Vaadin components’ shadow DOM through the `components` sub-folder in your `frontend/themes/<mytheme>` folder is disabled by default. Shadow DOM styling is no longer recommended (as of V24), but if you still need to use it, it can be enabled with the <<{articles}/flow/configuration/feature-flags#,`themeComponentStyles`>> feature flag.
237
237
238
-
The [classname]`@Theme` annotation is deprecated. Instead, [classname]`StyleSheet` annotation to be used for loading one or more stylesheets from public static resources locations (e.g. `META-INF/resources/`), whereas [classname]`CssImport` loads one or more stylesheets from the `src/main/frontend/` folder and use mechanisms native to HTML, CSS, and React (e.g. `@import url("morestyles.css")` in CSS).
239
-
240
-
`StyleSheet` annotation is now a recommended way to load Vaadin theme for the application — to be placed on the application class implementing [classname]`AppShellConfigurator`. Below are some examples of how to use it:
238
+
The [annotationname]`@Theme` annotation is deprecated. Instead, the [annotationname]`@StyleSheet` annotation is now the recommended way to load Vaadin themes and custom application styles. The annotation should be placed on the application class implementing [classname]`AppShellConfigurator`:
241
239
242
240
[source,java]
243
241
----
244
-
// theme selection
242
+
// Load Vaadin theme
245
243
@StyleSheet(Aura.STYLESHEET) // or Lumo.STYLESHEET
public class Application implements AppShellConfigurator {}
247
-
248
-
// or loading custom styles and theme:
249
-
250
-
@StyleSheet("styles.css")
251
-
public class Application implements AppShellConfigurator {}
252
-
253
-
// then using @import in the src/main/resources/META-INF/resources/styles.css:
254
-
255
-
@import 'aura/aura.css'; /* or 'lumo/lumo.css' */
256
-
// your custom styles go here ...
257
-
258
247
----
259
248
260
249
Stylesheets referenced by [annotationname]`@StyleSheet` annotation are loaded by the servlet container. If the application is configured to use a custom URL mapping for the [classname]`VaadinServlet` (e.g. `vaadin.url-mapping` setting in Spring applications), the referenced stylesheet must be prefixed by the `context://` protocol.
@@ -315,16 +304,16 @@ The Lumo theme is no longer loaded by default, except if you’re using the [cla
315
304
316
305
[source,java]
317
306
----
318
-
@StyleSheet(Lumo.STYLESHEET);
307
+
@StyleSheet(Lumo.STYLESHEET)
319
308
public class Application implements AppShellConfigurator {}
320
309
----
321
310
322
311
All Lumo styles, including badges, but excluding Lumo Utility Classes are included by default when the Lumo theme is loaded. To load the utility classes, add a separate [classname]`@StyleSheet` annotation:
323
312
324
313
[source,java]
325
314
----
326
-
@StyleSheet(Lumo.STYLESHEET);
327
-
@StyleSheet(Lumo.UTILITY_STYLESHEET);
315
+
@StyleSheet(Lumo.STYLESHEET)
316
+
@StyleSheet(Lumo.UTILITY_STYLESHEET)
328
317
public class Application implements AppShellConfigurator {}
0 commit comments