Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset inheritable styles #141

Merged
merged 4 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/mapml-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class MapViewer extends HTMLElement {
let mapDefaultCSS = document.createElement('style');
mapDefaultCSS.innerHTML =
`:host {` +
`all: initial;` + // Reset properties inheritable from html/body, as some inherited styles may cause unexpected issues with the map element's components (https://github.com/Maps4HTML/Web-Map-Custom-Element/issues/140).
`contain: content;` + // Contain layout and paint calculations within the map element.
`display: inline-block;` + // This together with dimension properties is required so that Leaflet isn't working with a height=0 box by default.
`overflow: hidden;` + // Make the map element behave and look more like a native element.
Expand Down
1 change: 1 addition & 0 deletions src/web-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class WebMap extends HTMLMapElement {
let mapDefaultCSS = document.createElement('style');
mapDefaultCSS.innerHTML =
`map[is="web-map"] {` +
`all: initial;` + // Reset properties inheritable from html/body, as some inherited styles may cause unexpected issues with the map element's components (https://github.com/Maps4HTML/Web-Map-Custom-Element/issues/140).
`contain: content;` + // Contain layout and paint calculations within the map element.
`display: inline-block;` + // This together with dimension properties is required so that Leaflet isn't working with a height=0 box by default.
`overflow: hidden;` + // Make the map element behave and look more like a native element.
Expand Down