From 341b72efbabe350364a405393abd32c690aa24a9 Mon Sep 17 00:00:00 2001 From: Simon Large Date: Wed, 28 Apr 2021 14:56:10 +0100 Subject: [PATCH] Change to inline SVG icon Use a single inline SVG icon in place of the two PNG icons. Correct alignment on touchscreens. The reason for using !important in the CSS is to prevent styling with high specificity from overriding the button icon and color. This can happen with the WordPress default 2021 theme. --- Control.FullScreen.css | 8 ++++++-- FullScreen.svg | 9 +++++++++ icon-fullscreen-2x.png | Bin 215 -> 0 bytes icon-fullscreen.png | Bin 139 -> 0 bytes 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 FullScreen.svg delete mode 100644 icon-fullscreen-2x.png delete mode 100644 icon-fullscreen.png diff --git a/Control.FullScreen.css b/Control.FullScreen.css index 96ae11e..b49e85a 100644 --- a/Control.FullScreen.css +++ b/Control.FullScreen.css @@ -1,5 +1,9 @@ -.fullscreen-icon { background-image: url(icon-fullscreen.png); } -.leaflet-retina .fullscreen-icon { background-image: url(icon-fullscreen-2x.png); background-size: 26px 26px; } +a.fullscreen-icon { + background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26' width='26' height='26'%3E%3Cpath d='m5 15v6h6v-2h-4v-4z'/%3E%3Cpath d='m21 15v6h-6v-2h4v-4z'/%3E%3Cpath d='m5 11v-6h6v2h-4v4z'/%3E%3Cpath d='m21 11v-6h-6v2h4v4z'/%3E%3C/svg%3E") no-repeat 0 0/26px 26px #fff !important; +} +.leaflet-touch a.fullscreen-icon { + background-position: 2px 2px !important; +} /* one selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */ .leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; } .leaflet-container:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; } diff --git a/FullScreen.svg b/FullScreen.svg new file mode 100644 index 0000000..5e115dc --- /dev/null +++ b/FullScreen.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/icon-fullscreen-2x.png b/icon-fullscreen-2x.png deleted file mode 100644 index efc0dfbe88abebfca73e6b8f85d394b18ed50906..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 215 zcmV;|04V>7P)O)1TqPTnLVqF#wv#GSWq1n8%slbs`HBHZ?sS2cOdO4)3 zT@^K9Om76kB8$NC<`?WoZbAH}${!OSb@1^=Ie$6%hU*r8f#k2me~dB4%mAHFdkApa RWdi^J002ovPDHLkV1k|JSg8O2 diff --git a/icon-fullscreen.png b/icon-fullscreen.png deleted file mode 100644 index 8ee244724d9910a51bbc2d96e9a9ae32f215ba58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI10wkH8TU>!ukf)1dNCji^0x1dB{|7(Vbls@z z&`|W{(@5ewlDVs2scim)WuJNY99-EnlGq#s*%$CIUSKd0XO#Bf;A4>yo5jJ-^3>7K lqDa%H!S~2LIiO4_{0&ssx(O;OXk;vd$@?2>|-4B<27B