Skip to content

Commit 1d0bc5c

Browse files
authored
feat(#558): Increase size and spacing of map buttons (#570)
1 parent 5160d76 commit 1d0bc5c

File tree

2 files changed

+49
-55
lines changed

2 files changed

+49
-55
lines changed

packages/web-forms/src/components/common/map/MapBlock.vue

Lines changed: 44 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const discardSavedFeature = () => {
173173
@use 'primeflex/core/_variables.scss' as pf;
174174
175175
.map-block-component {
176-
--odk-map-spacing: 10px;
176+
--odk-map-spacing: 8px;
177177
}
178178
179179
.map-block-component {
@@ -233,70 +233,64 @@ const discardSavedFeature = () => {
233233
}
234234
}
235235
236-
.control-bar {
236+
@mixin map-floating-control-bar {
237237
position: absolute;
238+
right: var(--odk-map-spacing);
238239
display: flex;
239240
flex-direction: column;
240-
top: var(--odk-map-spacing);
241-
right: var(--odk-map-spacing);
241+
flex-wrap: nowrap;
242+
align-items: center;
243+
box-shadow: none;
244+
background: none;
245+
overflow: hidden;
246+
gap: var(--odk-map-spacing);
242247
z-index: var(--odk-z-index-form-floating);
243-
gap: 4px;
248+
}
244249
245-
button {
246-
background: var(--odk-base-background-color);
247-
padding: 8px;
248-
border-radius: var(--odk-radius);
249-
border: 1px solid var(--odk-border-color);
250-
cursor: pointer;
251-
-webkit-tap-highlight-color: transparent;
252-
253-
&:hover {
254-
background: var(--odk-muted-background-color);
255-
}
250+
@mixin map-control-button {
251+
display: flex;
252+
align-items: center;
253+
justify-content: center;
254+
height: 42px;
255+
width: 42px;
256+
border: 1px solid var(--odk-border-color);
257+
border-radius: var(--odk-radius);
258+
background: var(--odk-base-background-color);
259+
font-size: 24px;
260+
font-weight: 300;
261+
color: var(--odk-text-color);
262+
cursor: pointer;
263+
-webkit-tap-highlight-color: transparent;
264+
265+
&:hover {
266+
background: var(--odk-muted-background-color);
267+
color: var(--odk-text-color);
268+
}
256269
257-
&:disabled {
258-
background: var(--odk-muted-background-color);
259-
cursor: not-allowed;
260-
}
270+
&:disabled {
271+
background: var(--odk-muted-background-color);
272+
cursor: not-allowed;
273+
}
274+
}
275+
276+
.control-bar {
277+
@include map-floating-control-bar;
278+
top: var(--odk-map-spacing);
279+
280+
button {
281+
@include map-control-button;
261282
}
262283
}
263284
264285
.map-block-component :deep(.ol-zoom) {
265-
position: absolute;
266-
right: var(--odk-map-spacing);
286+
@include map-floating-control-bar;
267287
bottom: 35px;
268-
display: flex;
269-
flex-direction: column;
270-
flex-wrap: nowrap;
271-
align-items: center;
272-
box-shadow: none;
273-
background: var(--odk-base-background-color);
274-
border-radius: var(--odk-radius);
275-
overflow: hidden;
276-
border: 1px solid var(--odk-border-color);
277288
278289
button,
279290
button:hover,
280291
button:focus,
281292
button:active {
282-
height: 37px;
283-
width: 36px;
284-
border: none;
285-
background: var(--odk-base-background-color);
286-
-webkit-tap-highlight-color: transparent;
287-
font-size: 24px;
288-
font-weight: 300;
289-
color: var(--odk-text-color);
290-
cursor: pointer;
291-
292-
&:first-child {
293-
border-bottom: 1px solid var(--odk-border-color);
294-
}
295-
296-
&:hover {
297-
background: var(--odk-muted-background-color);
298-
color: var(--odk-text-color);
299-
}
293+
@include map-control-button;
300294
}
301295
}
302296
@@ -353,10 +347,6 @@ const discardSavedFeature = () => {
353347
}
354348
355349
@media screen and (max-width: #{pf.$sm}) {
356-
.map-block-component {
357-
--odk-map-spacing: 5px;
358-
}
359-
360350
.map-block-component {
361351
height: fit-content;
362352
}
@@ -367,7 +357,7 @@ const discardSavedFeature = () => {
367357
height: calc(100vh - var(--map-status-bar-min-height) - var(--map-label-min-height));
368358
369359
:deep(.ol-zoom) {
370-
top: 165px;
360+
top: 195px;
371361
bottom: unset;
372362
}
373363
}

packages/web-forms/src/components/common/map/MapProperties.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,17 @@ const orderedProps = computed(() => {
134134
}
135135
136136
@media screen and (max-width: #{pf.$sm}) {
137+
.map-properties {
138+
--odk-map-properties-spacing-md: 8px;
139+
}
140+
137141
.map-properties {
138142
top: unset;
139143
bottom: 70px;
140144
left: 0;
141145
right: 0;
142146
margin: 0 auto;
143-
width: calc(100% - var(--odk-map-properties-spacing-md));
147+
width: calc(100% - (var(--odk-map-properties-spacing-md) * 2));
144148
max-height: 50%;
145149
}
146150
}

0 commit comments

Comments
 (0)