Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions articles/components/map/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`
95 changes: 95 additions & 0 deletions articles/components/map/styling.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe add an intro sentence as in other component pages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


[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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several icons are not in base styles / Aura:

  • --vaadin-map-icon-fullscreen
  • --vaadin-map-icon-close
  • --vaadin-map-icon-compass
  • --vaadin-map-icon-overview-map-expand

Though it looks like they should be, given that --vaadin-map-icon-overview-map-collapse for example is in there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, created a PR: vaadin/web-components#10576

|===
| 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+++<wbr>+++**[focused]**`
Keyboard Focused:: `vaadin-map+++<wbr>+++**[focus-ring]**`
Original file line number Diff line number Diff line change
Expand Up @@ -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<MapThemeBorderless> { // hidden-source-line
public static class Exporter extends DemoExporter<MapNoBorder> { // hidden-source-line
} // hidden-source-line
}
Loading