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

Improve css #20

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Improve css #20

wants to merge 6 commits into from

Conversation

johnd0e
Copy link

@johnd0e johnd0e commented Mar 19, 2019

  • unify indents
  • refine some values
  • smart align any leaflet control (not only zoom control / zoom slider)
  • examples: add options (mainly for easy position change)

This PR fixes last left item in https://github.com/kartena/Leaflet.Pancontrol/blob/master/TODO.md:

  • Do something about the hardcoded support for the zoom- and zoomslider controls.

This change is Reviewable

@johnd0e
Copy link
Author

johnd0e commented Mar 23, 2019

Alternatively we could use margin instead of position:
diff --git a/src/L.Control.Pan.css b/src/L.Control.Pa
index 071cfbb..b8f7c39 100644
--- a/src/L.Control.Pan.css
+++ b/src/L.Control.Pan.css
@@ -6,10 +6,10 @@
 }

 .leaflet-left .leaflet-control-pan {
-       left: -24.5px;
+       margin-left: -14.5px; /* 24.5-10 */
 }
 .leaflet-right .leaflet-control-pan {
-       right: -24.5px;
+       margin-right: -14.5px;
 }

 .leaflet-control-pan {
@@ -86,10 +86,10 @@
 }

 .leaflet-touch .leaflet-left .leaflet-control-pan {
-       left: -26px;
+       margin-left: -16px; /* 26-10 */
 }
 .leaflet-touch .leaflet-right .leaflet-control-pan {
-       right: -26px;
+       margin-right: -16px;
 }

 .leaflet-touch .leaflet-control-pan {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant