diff --git a/articles/components/map/index.adoc b/articles/components/map/index.adoc index 0131a01ffb..fa082d790d 100644 --- a/articles/components/map/index.adoc +++ b/articles/components/map/index.adoc @@ -521,26 +521,4 @@ Custom projections must be defined before using them as either user projection o ==== -== Theme Variants - -=== Borderless - -By default, Map has a visible, rounded border. -The border can be removed by using the `borderless` theme variant. - -[.example] --- -[source,typescript] ----- -include::{root}/frontend/demo/component/map/map-theme-borderless.ts[preimport,hidden] ----- - -ifdef::flow[] -[source,java] ----- -include::{root}/src/main/java/com/vaadin/demo/component/map/MapThemeBorderless.java[render,tags=snippet,indent=0,group=Flow] ----- -endif::[] --- - [discussion-id]`04C74C61-682E-40A8-B152-BEBF1C38C49C` diff --git a/articles/components/map/styling.adoc b/articles/components/map/styling.adoc new file mode 100644 index 0000000000..b234dc6f17 --- /dev/null +++ b/articles/components/map/styling.adoc @@ -0,0 +1,97 @@ +--- +title: Styling +page-title: How to style the Map component | Vaadin components +description: Styling API reference for the Map component. +meta-description: Customize the appearance of the Vaadin Map component to align with your application's theme. +order: 50 +--- += Map Styling + +== Style Variants + +Map supports the following style variants: + +[cols="1,3,1"] +|=== +| Variant | Description | Supported by + +|`no-border` +|Removes border around the Map component +|Aura, Lumo + +|=== + +[.example] +-- +[source,typescript] +---- +include::{root}/frontend/demo/component/map/map-no-border.ts[preimport,hidden] +---- + +ifdef::flow[] +[source,java] +---- +include::{root}/src/main/java/com/vaadin/demo/component/map/MapNoBorder.java[render,tags=snippet,indent=0,group=Flow] +---- +endif::[] + +-- + + +include::../_styling-section-theming-props.adoc[tag=style-properties] + +[cols="2,1"] +|=== +| Property | Supported by + +|`--vaadin-map-border-color` +|Aura, Lumo + +|`--vaadin-map-border-radius` +|Aura, Lumo + +|`--vaadin-map-control-size` +|Aura, Lumo + +|`--vaadin-map-controls-inset` +|Aura, Lumo + +|`--vaadin-map-icon-attribution-collapse` +|Aura, Lumo + +|`--vaadin-map-icon-attribution-expand` +|Aura, Lumo + +|`--vaadin-map-icon-close` +|Aura, Lumo + +|`--vaadin-map-icon-compass` +|Aura, Lumo + +|`--vaadin-map-icon-fullscreen` +|Aura, Lumo + +|`--vaadin-map-icon-overview-map-collapse` +|Aura, Lumo + +|`--vaadin-map-icon-overview-map-expand` +|Aura, Lumo + +|`--vaadin-map-icon-zoom-in` +|Aura, Lumo + +|`--vaadin-map-icon-zoom-out` +|Aura, Lumo + +|=== + + +include::../_styling-section-intros.adoc[tag=selectors] + + +Root element:: `vaadin-map` + +=== States + +Focused:: `vaadin-map++++++**[focused]**` +Keyboard Focused:: `vaadin-map++++++**[focus-ring]**` diff --git a/frontend/demo/component/map/map-theme-borderless.ts b/frontend/demo/component/map/map-no-border.ts similarity index 100% rename from frontend/demo/component/map/map-theme-borderless.ts rename to frontend/demo/component/map/map-no-border.ts diff --git a/src/main/java/com/vaadin/demo/component/map/MapThemeBorderless.java b/src/main/java/com/vaadin/demo/component/map/MapNoBorder.java similarity index 60% rename from src/main/java/com/vaadin/demo/component/map/MapThemeBorderless.java rename to src/main/java/com/vaadin/demo/component/map/MapNoBorder.java index 0ade627d0b..22fa350c22 100644 --- a/src/main/java/com/vaadin/demo/component/map/MapThemeBorderless.java +++ b/src/main/java/com/vaadin/demo/component/map/MapNoBorder.java @@ -6,17 +6,17 @@ import com.vaadin.flow.component.map.Map; import com.vaadin.flow.component.map.MapVariant; -@Route("map-theme-borderless") -public class MapThemeBorderless extends Div { +@Route("map-no-border") +public class MapNoBorder extends Div { - public MapThemeBorderless() { + public MapNoBorder() { Map map = new Map(); add(map); // tag::snippet[] - map.addThemeVariants(MapVariant.BORDERLESS); + map.addThemeVariants(MapVariant.LUMO_NO_BORDER); // end::snippet[] } - public static class Exporter extends DemoExporter { // hidden-source-line + public static class Exporter extends DemoExporter { // hidden-source-line } // hidden-source-line }