Skip to content

Commit

Permalink
fix(ViewportOrientationMarkers): Consider scrollbar and marker width …
Browse files Browse the repository at this point in the history
…while positioning markers

In small screens or with multiple layout modes where everything is compressed, the second and third
letters are at least partially cut off. This update considers a min-width so the text is always
visible.
  • Loading branch information
igoroctaviano committed Dec 3, 2021
1 parent a29c466 commit dc7c081
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/ViewportOrientationMarkers/ViewportOrientationMarkers.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.ViewportOrientationMarkers {
--marker-width: 100px;
--scrollbar-width: 20px;
pointer-events: none;
font-size: 15px;
color: #ccc;
Expand All @@ -15,13 +17,16 @@
top: 47%;
left: 5px;
}

.ViewportOrientationMarkers .right-mid {
top: 47%;
left: 97%;
left: calc(100% - var(--marker-width) - var(--scrollbar-width));
}

.ViewportOrientationMarkers .bottom-mid {
top: 97%;
left: 47%;
}
.ViewportOrientationMarkers .right-mid .orientation-marker-value {
display: flex;
justify-content: flex-end;
min-width: var(--marker-width);
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ViewportOrientationMarkers extends PureComponent {
className={`${m}-mid orientation-marker`}
key={`${m}-mid orientation-marker`}
>
{markers[m]}
<div className="orientation-marker-value">{markers[m]}</div>
</div>
));

Expand Down

0 comments on commit dc7c081

Please sign in to comment.