[web] Save space when rendering a selector #898
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Back in May, we introduced a preliminary version of a device selector (see #578). Although we like its look and feel, after extending its usage to localization page (#881) and space policy selector (#883), we've realized that there is too much wasted space between selector options. Even after reducing it accidentally as part of #883 (00c36b9, 15aab26)
Solution
Drop the space between options to make the selector looks like what it is: a single widget.
Testing
Notes
With that change, it's true that a selector supporting multiple selection could look a bit weird at first sight when there are two or more options selected in a row. That's why I've kept the
box-shadow
for the selected options, which creates the impression that there is a slight separation between them.Click to show/hide screenshots
In any case, I'd like to go ahead without adding an exception for the only multiple selection we have at this time. The reason is that we're going to rework these selectors ASAP due to a few known issues. Most probably, the new version will include an extra widget per option: radio for single selection, checkbox for multiple selection. I'm confident on the fact that these widgets will throw away the potential issue we might introduce by removing the wasted space between options.
So, let's save time now 🙏
Screenshots
Click to show/hide more screenshots