Allow border radius if only one control in field, fixes #1656 #2157
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.
This is an improvement.
If there is only one child inside a field with addons, the current first and last child selectors remove any radius. Since a single control would be both a first and last child at the same time, it gets canceled out. Fixes #1656
Proposed solution
This solution leverages the :only-child property to not apply this rule if there is only one control within a given field with addons.
Tradeoffs
None that I an think of, other than it may suddenly add radius to a .control only used once under a .field.has-addons.
Testing Done
I've tested this feature. Here is a field group:
![screen shot 2018-10-14 at 1 28 11 am](https://user-images.githubusercontent.com/6226188/46913758-80cc3500-cf50-11e8-8288-c5c4e35ad2cb.png)
![screen shot 2018-10-14 at 1 28 30 am](https://user-images.githubusercontent.com/6226188/46913760-8fb2e780-cf50-11e8-8e30-a511c59f8c6b.png)
![screen shot 2018-10-14 at 1 30 47 am](https://user-images.githubusercontent.com/6226188/46913782-ff28d700-cf50-11e8-9d88-5e44ff1d9cfc.png)
![screen shot 2018-10-14 at 1 31 05 am](https://user-images.githubusercontent.com/6226188/46913783-0223c780-cf51-11e8-8c70-892395c4c808.png)
![screen shot 2018-10-14 at 1 31 25 am](https://user-images.githubusercontent.com/6226188/46913784-03ed8b00-cf51-11e8-9aa2-73969fdfaf6b.png)
And here is what this same field group with only one control looks like:
Notice the missing radius? This is what this fix does, before and after with one, two, three buttons:
With the addition of the :not(:only-child) selector, the :first-child and :last-child rules are ignored when there's only one child.