Skip to content

Commit

Permalink
consolidate map size css (fisharebest#4808)
Browse files Browse the repository at this point in the history
* consolidate map size css into one file (/resources/css/_maps.css)

* Remove use of wt-global for sidebar background

* Adjust class names and use ::backdrop pseudo class for all themes
  • Loading branch information
ddrury committed Jul 16, 2023
1 parent 72aa5b6 commit c265768
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 65 deletions.
2 changes: 1 addition & 1 deletion resources/css/_base.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
@import "_blocks.css";
@import "_charts.css";
@import "_colorbox.css";
@import "_leaflet.css";
@import "_lists.css";
@import "_markdown.css";
@import "_maps.css";
@import "_mime-type-icons.css";
@import "_on-screen-keyboard.css";
@import "_pages.css";
Expand Down
10 changes: 0 additions & 10 deletions resources/css/_chart-pedigree-map.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
--wt-pedigree-map-gen-9: pink;
--wt-pedigree-map-gen-10: magenta;
--wt-pedigree-map-gen-11: maroon;
--wt-pedigree-map-height: 70vh;
}

.wt-pedigree-map-gen-0 {
Expand Down Expand Up @@ -81,12 +80,3 @@
.wt-pedigree-map-gen-11 {
color: var(--wt-pedigree-map-gen-11);
}

.wt-pedigree-map-map {
height: var(--wt-pedigree-map-height);
}

.wt-pedigree-map-sidebar {
height: var(--wt-pedigree-map-height);
overflow-y: auto;
}
13 changes: 0 additions & 13 deletions resources/css/_list-places.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,3 @@
*
* wt-route-place-list
*/

:root {
--wt-place-hierarchy-map-height: 70vh;
}

.wt-place-hierarchy-map {
height: var(--wt-place-hierarchy-map-height);
}

.wt-place-hierarchy-sidebar {
height: var(--wt-place-hierarchy-map-height);
overflow-y: auto;
}
21 changes: 21 additions & 0 deletions resources/css/_leaflet.css → resources/css/_maps.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

:root {
--wt-map-height: 70vh;
}

/*
* Formatting for LeafletJS based maps.
*/
Expand All @@ -34,3 +38,20 @@
.leaflet-layerstree-node .leaflet-layerstree-node .leaflet-layerstree-header-name {
font-weight: normal;
}

.wt-map {
height: var(--wt-map-height);
}

:fullscreen .wt-map {
height: 100%;
}

.wt-map-sidebar {
height: var(--wt-map-height);
overflow-y: auto;
}

:fullscreen .wt-map-sidebar {
height: 100%;
}
12 changes: 0 additions & 12 deletions resources/css/_tab-places.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,3 @@
* wt-tabs-individual
* +--- wt-tab-places
*/

:root {
--wt-places-tab-map-height: 70vh;
}
.wt-places-tab-map {
height: var(--wt-places-tab-map-height);
}

.wt-places-tab-sidebar {
height: var(--wt-places-tab-map-height);
overflow-y: auto;
}
13 changes: 2 additions & 11 deletions resources/css/administration.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ h4 {
font-size: 1.25rem;
}

.wt-global {
::backdrop, .wt-global {
background: url(administration/paper_fibers.png); /* http://www.subtlepatterns.com */
}

Expand All @@ -51,20 +51,11 @@ h4 {
}

@media (min-device-pixel-ratio: 2) {
.wt-global {
::backdrop, .wt-global {
background: url(administration/paper_fibers_@2X.png);
}
}

/* Location edit maps */
.wt-location-edit-map {
height: 55vh;
}

:fullscreen .wt-location-edit-map {
height: 100%;
}

/* Raw GEDCOM data */
.gedcom-data {
white-space: pre-wrap;
Expand Down
2 changes: 1 addition & 1 deletion resources/css/clouds.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ table {
* +---wt-footer wt-footer-xxxxx
*/

.wt-global {
::backdrop, .wt-global {
background: #c8e7ff url(clouds/images/background.png) repeat-x fixed top left;
color: #006;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/css/colors.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
* +---wt-footer wt-footer-xxxxx
*/

.wt-global {
::backdrop, .wt-global {
background: #fff;
color: #333;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/css/fab.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ table {
* +---wt-footer wt-footer-xxxxx
*/

.wt-global {
::backdrop, .wt-global {
color: #555;
}

Expand Down
2 changes: 1 addition & 1 deletion resources/css/minimal.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ table {
* +---wt-footer wt-footer-xxxxx
*/

.wt-global {
::backdrop, .wt-global {
/* Avoid extremes of black and white. It is better for users with dyslexia. */
color: #0a0a0a;
background-color: #f9f9f9;
Expand Down
2 changes: 1 addition & 1 deletion resources/css/webtrees.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ table {
* +---wt-footer wt-footer-xxxxx
*/

.wt-global {
::backdrop, .wt-global {
color: #555;
}

Expand Down
2 changes: 1 addition & 1 deletion resources/css/xenea.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ table {
* +---wt-footer wt-footer-xxxxx
*/

.wt-global {
::backdrop, .wt-global {
color: #006;
}

Expand Down
4 changes: 2 additions & 2 deletions resources/views/admin/location-edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ use Fisharebest\Webtrees\View;
<h1><?= $title ?></h1>

<div class="row wt-location-edit-wrapper wt-fullscreen-container">
<div id="wt-map" class="col-sm-9 wt-ajax-load wt-location-edit-map" dir="ltr"></div>
<div id="wt-map" class="col-sm-9 wt-ajax-load wt-map" dir="ltr"></div>

<div class="col-sm-3">
<div class="col-sm-3 wt-map-sidebar">
<form method="post" action="<?= e(route(MapDataSave::class)) ?>">
<input type="hidden" name="parent_id" value="<?= $parent->id() ?>">
<input type="hidden" name="place_id" value="<?= $location->id() ?>">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/individual-page-sidebars.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use Illuminate\Support\Collection;
*/
?>

<div class="accordion" id="sidebar">
<div class="accordion wt-sidebar" id="sidebar">
<?php foreach ($sidebars as $sidebar) : ?>
<div class="accordion-item">
<div class="accordion-header" id="sidebar-header-<?= $sidebar->name() ?>">
Expand Down
6 changes: 3 additions & 3 deletions resources/views/modules/pedigree-map/chart.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use Fisharebest\Webtrees\View;
?>

<div class="row my-4 gchart wt-pedigree-map-wrapper wt-fullscreen-container">
<div id="wt-map" class="col-sm-9 wt-ajax-load wt-map wt-pedigree-map-map" dir="ltr"></div>
<ul class="col-sm-3 wt-pedigree-map-sidebar wt-page-options-value list-unstyled px-1 mb-0"></ul>
<div id="wt-map" class="col-sm-9 wt-ajax-load wt-map" dir="ltr"></div>
<ul class="col-sm-3 wt-map-sidebar wt-page-options-value list-unstyled px-1 mb-0"></ul>
</div>

<?php View::push('javascript') ?>
Expand All @@ -22,7 +22,7 @@ use Fisharebest\Webtrees\View;

(function () {
const config = <?= json_encode($leaflet_config, JSON_THROW_ON_ERROR) ?>;
const sidebar = document.querySelector('.wt-pedigree-map-sidebar');
const sidebar = document.querySelector('.wt-map-sidebar');

const scrollOptions = {
behavior: "smooth",
Expand Down
6 changes: 3 additions & 3 deletions resources/views/modules/place-hierarchy/map.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use Fisharebest\Webtrees\View;
?>

<div class="row gchart wt-place-hierarchy-wrapper wt-fullscreen-container">
<div id="wt-map" class="col-sm-9 wt-ajax-load wt-map wt-place-hierarchy-map" dir="ltr"></div>
<ul class="col-sm-3 wt-place-hierarchy-sidebar wt-page-options-value list-unstyled px-md-1 mb-0"></ul>
<div id="wt-map" class="col-sm-9 wt-ajax-load wt-map" dir="ltr"></div>
<ul class="col-sm-3 wt-map-sidebar wt-page-options-value list-unstyled px-md-1 mb-0"></ul>
</div>

<?php View::push('javascript') ?>
Expand All @@ -24,7 +24,7 @@ use Fisharebest\Webtrees\View;
const config = <?= json_encode($leaflet_config, JSON_THROW_ON_ERROR) ?>;

let map = null;
const sidebar = document.querySelector('.wt-place-hierarchy-sidebar');
const sidebar = document.querySelector('.wt-map-sidebar');

const scrollOptions = {
behavior: "smooth",
Expand Down
6 changes: 3 additions & 3 deletions resources/views/modules/places/tab.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use Fisharebest\Webtrees\I18N;

<div class="py-4">
<div class="row gchart wt-places-tab-wrapper wt-fullscreen-container">
<div id="wt-map" class="col-sm-9 wt-ajax-load wt-map wt-places-tab-map" dir="ltr"></div>
<ul class="col-sm-3 wt-places-tab-sidebar wt-page-options-value list-unstyled px-md-1"></ul>
<div id="wt-map" class="col-sm-9 wt-ajax-load wt-map" dir="ltr"></div>
<ul class="col-sm-3 wt-map-sidebar wt-page-options-value list-unstyled px-md-1"></ul>
</div>
</div>

Expand All @@ -25,7 +25,7 @@ use Fisharebest\Webtrees\I18N;
const config = <?= json_encode($leaflet_config, JSON_THROW_ON_ERROR) ?>;

let map = null;
const sidebar = document.querySelector('.wt-places-tab-sidebar');
const sidebar = document.querySelector('.wt-map-sidebar');

const scrollOptions = {
behavior: "smooth",
Expand Down

0 comments on commit c265768

Please sign in to comment.