JGirault has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/306557

Change subject: Import wmui-base.less and override leaflet styling to match 
wikimedia style.
......................................................................

Import wmui-base.less and override leaflet styling to match wikimedia style.

Bug: T143833
Change-Id: I2c3f422679c437e923d47bab3f55497af9f39c86
---
M extension.json
M package.json
A styles/leaflet-overrides.less
3 files changed, 106 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/57/306557/1

diff --git a/extension.json b/extension.json
index b978281..c909be7 100644
--- a/extension.json
+++ b/extension.json
@@ -42,7 +42,8 @@
                        "styles": [
                                "styles/kartographer.less",
                                "styles/control-attribution.less",
-                               "styles/control-scale.less"
+                               "styles/control-scale.less",
+                               "styles/leaflet-overrides.less"
                        ],
                        "targets": [
                                "mobile",
diff --git a/package.json b/package.json
index c21c7b2..2ebea7e 100644
--- a/package.json
+++ b/package.json
@@ -24,6 +24,7 @@
   "dependencies": {
     "leaflet": "^0.7.7",
     "leaflet-sleep": "juliengirault/Leaflet.Sleep#v0.5.0",
-    "maki": "^0.5.0"
+    "maki": "^0.5.0",
+    "wmui-base": 
"git+https://phabricator.wikimedia.org/diffusion/WMUI/wikimedia-ui.git";
   }
 }
diff --git a/styles/leaflet-overrides.less b/styles/leaflet-overrides.less
new file mode 100644
index 0000000..5eda046
--- /dev/null
+++ b/styles/leaflet-overrides.less
@@ -0,0 +1,102 @@
+@import '../node_modules/wmui-base/wmui-base.less';
+
+/* stylelint-disable no-descending-specificity */
+.mw-kartographer-map {
+
+       &.leaflet-container {
+               font: 12px @font-family-base;
+               color: @color-base;
+
+               .marker-description img {
+                       width: 100%;
+                       height: auto;
+                       margin-bottom: 0;
+                       margin-top: 0.5em;
+               }
+
+               a {
+                       color: @color-primary;
+
+                       &:hover {
+                               color: @color-primary-hover;
+                               text-decoration: underline;
+                       }
+                       &:active {
+                               color: @color-primary-active;
+                       }
+                       &:focus {
+                               color: @color-primary-focus;
+                       }
+               }
+       }
+
+       /* Leaflet Popups */
+
+       .leaflet-popup-content {
+               padding: 1em;
+       }
+
+       .leaflet-popup-content .marker-title {
+               //font-weight: 400;
+               text-align: center;
+
+               & > a {
+                       font-weight: bold;
+               }
+       }
+
+       .leaflet-popup-content .marker-description {
+               text-align: center;
+       }
+
+       .leaflet-popup-content-wrapper,
+       .map-legends,
+       .map-tooltip {
+               border-radius: @border-radius-base;
+       }
+
+       /* Leaflet Controls */
+
+       @border-color-base: #71777d;
+       @background-color-base-hover: #eaecf0;
+       .leaflet-control-layers,
+       .leaflet-bar {
+               background-color: @background-color-base;
+               border: @border-base;
+               border-color: @border-color-base;
+               border-radius: @border-radius-base;
+               box-shadow: none;
+       }
+       .leaflet-bar a,
+       .leaflet-bar a:hover {
+               color: #000;
+               color: rgb( 0, 0, 0 );
+               border-bottom-color: @border-color-base;
+       }
+       .leaflet-bar a:hover,
+       .leaflet-bar a:active {
+               background-color: @background-color-base-hover;
+               cursor: pointer;
+       }
+       .leaflet-bar a:hover:first-child {
+               border-radius: @border-radius-base @border-radius-base 0 0;
+       }
+       .leaflet-bar a:hover:last-child {
+               border-bottom: 0;
+               border-radius: 0 0 @border-radius-base @border-radius-base;
+       }
+       .leaflet-bar a:hover:only-of-type {
+               border-radius: @border-radius-base;
+       }
+
+       .leaflet-control-attribution:after,
+       .leaflet-control-zoom-in,
+       .leaflet-control-zoom-out,
+       .leaflet-popup-close-button,
+       .leaflet-control-layers-toggle,
+       .map-tooltip .close,
+       .leaflet-container.dark .map-tooltip .close,
+       .mapbox-icon {
+               opacity: 1;
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/306557
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2c3f422679c437e923d47bab3f55497af9f39c86
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: JGirault <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to