Skip to content

Commit

Permalink
[Maps] Fix text readability on map scale, attribution, and coordinate…
Browse files Browse the repository at this point in the history
… controls (elastic#189639)

## Summary

Fixes elastic#128783

This PR fixes the visualization of the texts in Maps scale bar,
attribution, and coordinate controls with a dark background.

## Context

While checking on the scale bar component of the map I saw this SCSS
mixin that seemed to be broken.

Originally I thought on fixing the shadow but the readability of the
text is not great for dark background (see
7f2a698)

<details><summary>Adding a shadow</summary>

| before | after |
| :--:| :--:| 

|![2024-07-31_16-17](https://github.com/user-attachments/assets/23239b0d-826e-482e-ac67-fe7faa50d696)
|
![2024-07-31_16-18](https://github.com/user-attachments/assets/dffe0873-86dd-46b3-877e-ff4f5ef92c32)
|
</details>

So I decided to propose to fix this by adding a background as is usual
in other platforms.


![image](https://github.com/user-attachments/assets/7a7d0d11-1cf6-4961-b872-a5247c930363)


![image](https://github.com/user-attachments/assets/2c3d893b-f380-4724-9ad5-93adb6ec9fb6)


![image](https://github.com/user-attachments/assets/1a9becbc-40b1-4631-8360-f2a1bfafc9c2)
  • Loading branch information
jsanz authored Aug 27, 2024
1 parent 9293bc1 commit 32dd373
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
bottom: $euiSizeM;
pointer-events: none;
color: $euiTextColor;
border-left: 2px solid $euiTextColor;
border-bottom: 2px solid $euiTextColor;
border-left: 2px solid rgba($euiTextColor, .6);
border-bottom: 2px solid rgba($euiTextColor, .6);
text-align: right;
@include mapOverlayIsTextOnly;
}

.mapScaleControlFullScreen {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@mixin mapOverlayIsTextOnly {
text-shadow:
0 0 2px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade 0 0 1px $euiColorEmptyShade 0 0 1px $euiColorEmptyShade;
background-color: $euiPageBackgroundColor;

padding-left: $euiSizeXS;
padding-right: $euiSizeXS;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@include mapOverlayIsTextOnly;
@include euiTextBreakWord;
pointer-events: all;
padding-left: $euiSizeM;
}

.mapAttributionControl__fullScreen {
Expand Down

0 comments on commit 32dd373

Please sign in to comment.