Hi Lars! The overlay elements in v10 are a bit special, including Dialog, Notification, and the dropdown elements of ComboBox, DatePicker, ContextMenu, and Select (coming in v12).
With those components, the main element (f.e. <vaadin-dialog>) is not the one which is visually shown. Instead, another element (f.e. <vaadin-dialog-overlay>) is created directly under the <body> element, to escape any parent stacking contexts.
The class attribute is not copied from the main element to the actual overlay element. In the latest versions of the overlay elements (currently in beta), the theme attribute is copied from the main element to the overlay elements, allowing you to style individual overlay elements.
To style a Dialog, you need to do the following (assuming you are using the latest beta version of the component):
In vaadin 12 we can expect to style a dialog with dialog.addClassName(“my-class”); and reach the border of the dialog?
No.
The class attribute is not copied to the overlay component. But the theme attribute is, so you can use that to style the overlays. See my example above
Jouni Koivuviita:
Hi Lars! The overlay elements in v10 are a bit special, including Dialog, Notification, and the dropdown elements of ComboBox, DatePicker, ContextMenu, and Select (coming in v12).
With those components, the main element (f.e. <vaadin-dialog>) is not the one which is visually shown. Instead, another element (f.e. <vaadin-dialog-overlay>) is created directly under the <body> element, to escape any parent stacking contexts.
The class attribute is not copied from the main element to the actual overlay element. In the latest versions of the overlay elements (currently in beta), the theme attribute is copied from the main element to the overlay elements, allowing you to style individual overlay elements.
To style a Dialog, you need to do the following (assuming you are using the latest beta version of the component):