Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow border radius if only one control in field, fixes #1656 #2157

Merged
merged 1 commit into from
Oct 28, 2018

Conversation

jcs224
Copy link
Contributor

@jcs224 jcs224 commented Oct 14, 2018

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
And here is what this same field group with only one control looks like:
screen shot 2018-10-14 at 1 28 30 am
Notice the missing radius? This is what this fix does, before and after with one, two, three buttons:
screen shot 2018-10-14 at 1 30 47 am
screen shot 2018-10-14 at 1 31 05 am
screen shot 2018-10-14 at 1 31 25 am

With the addition of the :not(:only-child) selector, the :first-child and :last-child rules are ignored when there's only one child.

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. This leverages the :only-child property to not apply this rule if there is only one control.
@jcs224 jcs224 changed the title Allow border radius if only one control in field Allow border radius if only one control in field, fixes #1656 Oct 14, 2018
@jgthms jgthms merged commit 8355aa3 into jgthms:master Oct 28, 2018
@My1
Copy link

My1 commented Oct 28, 2018

awesome. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

change/feature Request: Border-radiuses on .field.has-addons
3 participants