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

Fieldset disable #2077

Merged
merged 4 commits into from
May 27, 2022
Merged

Fieldset disable #2077

merged 4 commits into from
May 27, 2022

Conversation

mlynam
Copy link
Contributor

@mlynam mlynam commented May 18, 2022

What are you trying to accomplish?

The fieldset can be used to disable all child inputs when it is disabled. Currently, @primer/css does not render .form-control as disabled when a parent fieldset is disabled. This PR supports the visual feedback on .form-control when a parent fieldset is disabled.

What approach did you choose and why?

I used a local mixin in form-control.scss to keep the codebase dry and to ensure the disabled style was consistent when applied via .form-control:disabled or fieldset:disabled .form-control

What should reviewers focus on?

Reviewers should ensure my local mixin approach is appropriate for readability and code-style.

I noted that the Storybook instance overrides the fieldset styling (from normalize.css) found in form-control.scss and I was unsure what the approach should be to ensure only the @primer/css styling wins. I did not want to apply !important specificity as there would be drawbacks to that approach.

Can these changes ship as is? Yes

  • Yes, this PR does not depend on additional changes. 🚢

@mlynam mlynam requested a review from a team as a code owner May 18, 2022 17:45
@mlynam mlynam requested a review from langermank May 18, 2022 17:45
@changeset-bot
Copy link

changeset-bot bot commented May 18, 2022

🦋 Changeset detected

Latest commit: 5f10b78

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mlynam
Copy link
Contributor Author

mlynam commented May 24, 2022

Is there anything I can do to improve this PR and get it shipped?

@mlynam mlynam requested a review from simurai May 26, 2022 17:20
@simurai simurai enabled auto-merge (squash) May 27, 2022 00:17
Copy link
Contributor

@simurai simurai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.. @mlynam thanks. 🙇

@simurai simurai merged commit ab078a5 into primer:main May 27, 2022
@primer-css primer-css mentioned this pull request May 27, 2022
@mlynam mlynam deleted the fieldset-disable branch May 27, 2022 15:11
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.

2 participants