From 250579eaa25df5283493c9b8fac7b620b3d0781b Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 27 Jan 2025 16:50:27 +0100 Subject: [PATCH] chore: better styling for star button in caption panel Co-authored-by: David Larlet --- umap/static/umap/base.css | 2 +- umap/static/umap/css/bar.css | 12 ++---------- umap/static/umap/css/form.css | 22 ++++++++++++---------- umap/static/umap/css/icon.css | 4 ++-- umap/static/umap/css/panel.css | 3 ++- umap/static/umap/js/modules/caption.js | 2 +- umap/static/umap/js/modules/form/fields.js | 10 +++++----- umap/static/umap/js/modules/ui/bar.js | 6 +++--- umap/static/umap/js/modules/umap.js | 2 +- umap/static/umap/map.css | 1 - umap/tests/integration/test_edit_map.py | 2 +- 11 files changed, 30 insertions(+), 36 deletions(-) diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index a9f3929b..f3ff8f4e 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -46,7 +46,7 @@ h3, h4, h5 { margin-bottom: 14px; } p { - line-height: 21px; + line-height: 1.4; margin-top: 14px; margin-bottom: 14px; } diff --git a/umap/static/umap/css/bar.css b/umap/static/umap/css/bar.css index 510ab3c4..7f90ad64 100644 --- a/umap/static/umap/css/bar.css +++ b/umap/static/umap/css/bar.css @@ -1,7 +1,6 @@ .umap-main-edit-toolbox [type=button] { color: #fff; font-size: 1em; - border: none; background-color: var(--color-darkGray); width: auto; margin-bottom: 0; @@ -11,7 +10,7 @@ } .leaflet-container [type=button].umap-help-link { - padding-bottom: 3px; + padding: 0 var(--text-margin); background-color: inherit; } .leaflet-container .edit-save, @@ -20,8 +19,6 @@ .leaflet-container .connected-peers { display: block; - border: none; - border-radius: 20px; height: 32px; line-height: 30px; padding: 0 20px; @@ -37,11 +34,6 @@ color: var(--color-darkGray); } -.leaflet-container .edit-cancel, -.leaflet-container .edit-disable, -.leaflet-container .connected-peers{ - border: 0.5px solid rgba(153, 153, 153, 0.40); -} .leaflet-container .edit-cancel:hover, .leaflet-container .edit-disable:hover { border: 0.5px solid rgba(153, 153, 153, 0.80); @@ -120,7 +112,7 @@ column-gap: 10px; } .umap-right-edit-toolbox { - align-items: baseline; + align-items: center; } .umap-main-edit-toolbox .logo { diff --git a/umap/static/umap/css/form.css b/umap/static/umap/css/form.css index e4ad4427..52bc94ca 100644 --- a/umap/static/umap/css/form.css +++ b/umap/static/umap/css/form.css @@ -76,15 +76,14 @@ select[multiple="multiple"] { .button, [type="button"], input[type="submit"] { - display: block; + display: flex; + align-items: center; margin-bottom: 14px; text-align: center; border-radius: 2px; font-weight: normal; cursor: pointer; - padding: 7px 14px; - min-height: 32px; - line-height: 32px; + padding: 3px 12px; border: none; text-decoration: none; background-color: white; @@ -132,6 +131,11 @@ button.flat:hover, .dark [type="button"].flat:hover { text-decoration: underline; } +.dark button.round, +button.round { + border-radius: 20px; + border: 0.5px solid rgba(153, 153, 153, 0.40); +} .help-text, .helptext { display: block; padding: 7px 7px; @@ -572,17 +576,11 @@ input.blur { border-start-end-radius: 0; border-end-end-radius: 0; } -.blur + .button:before, -.blur + [type="button"]:before { - content: '✔'; -} .blur + .button, .blur + [type="button"] { width: 40px; - height: 18px; display: inline-block; vertical-align: middle; - line-height: 18px; border-start-start-radius: 0; border-end-start-radius: 0; box-sizing: border-box; @@ -591,6 +589,10 @@ input[type=hidden].blur + .button, input[type=hidden].blur + [type="button"] { display: none; } +.blur-container { + display: flex; + align-items: stretch; +} .copiable-input { display: flex; align-items: end; diff --git a/umap/static/umap/css/icon.css b/umap/static/umap/css/icon.css index df203121..77ed5191 100644 --- a/umap/static/umap/css/icon.css +++ b/umap/static/umap/css/icon.css @@ -17,11 +17,11 @@ background-image: url('../img/24.svg'); --tile: -36px; height: 36px; - line-height: 36px; width: 36px; } .icon + span { - margin-inline-start: 10px; + margin-inline-start: 5px; + margin-inline-end: 5px; } html[dir="rtl"] .icon { transform: scaleX(-1); diff --git a/umap/static/umap/css/panel.css b/umap/static/umap/css/panel.css index 5f35938d..b4e6af3f 100644 --- a/umap/static/umap/css/panel.css +++ b/umap/static/umap/css/panel.css @@ -42,7 +42,8 @@ padding: var(--panel-gutter); } .panel h3 { - line-height: 120%; + display: flex; + align-items: center; } .panel .counter::before { counter-increment: step; diff --git a/umap/static/umap/js/modules/caption.js b/umap/static/umap/js/modules/caption.js index 30113708..fbc7f3ec 100644 --- a/umap/static/umap/js/modules/caption.js +++ b/umap/static/umap/js/modules/caption.js @@ -10,7 +10,7 @@ const TEMPLATE = `

- +

diff --git a/umap/static/umap/js/modules/form/fields.js b/umap/static/umap/js/modules/form/fields.js index 1ff8b5b0..dc97bed3 100644 --- a/umap/static/umap/js/modules/form/fields.js +++ b/umap/static/umap/js/modules/form/fields.js @@ -217,7 +217,7 @@ Fields.BlurInput = class extends Fields.Input { } getTemplate() { - return `${super.getTemplate()}` + return `
${super.getTemplate()}
` } build() { @@ -856,10 +856,10 @@ Fields.IconUrl = class extends Fields.BlurInput { } buildInput(parent, value) { - const input = Utils.loadTemplate('') - const button = Utils.loadTemplate('') - parent.appendChild(input) - parent.appendChild(button) + const [element, { input }] = Utils.loadTemplateWithRefs( + '
' + ) + parent.appendChild(element) if (value) input.value = value input.addEventListener('blur', () => { // Do not clear this.input when focus-blur diff --git a/umap/static/umap/js/modules/ui/bar.js b/umap/static/umap/js/modules/ui/bar.js index 80202616..de446352 100644 --- a/umap/static/umap/js/modules/ui/bar.js +++ b/umap/static/umap/js/modules/ui/bar.js @@ -7,8 +7,8 @@ const TOP_BAR_TEMPLATE = `
- - + +
- +