-
Notifications
You must be signed in to change notification settings - Fork 201
refactor(fieldlabel): spectrum-Form cleanup and fixes #2173
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
Conversation
🚀 Deployed on https://pr-2173--spectrum-css.netlify.app |
c0bfbb7
to
ec2fa8f
Compare
cd82d6b
to
9690fa5
Compare
112a6cc
to
1dd9d0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! We talked offline about getting the space between fields validated by design, but they are looking more spacious to me.
I checked with the design team and they're good with that updated spacing on the "Labels Above" variant. |
- Fixes missing spacing between form items in Labels Above variant. This was using the wrong token (top-to-asterisk) - Removes --spectrum-field-label-top-to-asterisk as it is no longer used - Cleans up the CSS and its custom properties a bit - Removed two comments that were no longer applicable. One mentioned a docs file that does not seem to exist anymore, and the other mentioned a token value of 20px but it doesn't equal 20px. - Fixes form negative margin being too large and it moving outside its container. Instead use same value as border-spacing to remove the extra space, to make this like a margin top and bottom of zero which seems like the original intention.
Buttons will default to a type of "submit" within a form, resulting in unexpected form submission on click, which was happening in the examples. Sets type="button" on usage of button element used for the picker in the docs.
Add stories for the "Form" component that exists as its own entry in the docs (the CSS actually exists within the fieldlabel component).
- Fix incorrect field group usage in example markup for Form. Previously had a "for" attribute for an ID that didn't exist, and was using a label. But this was more of a fieldset usage and needed to use the aria attributes (reference Field group). - Improves some titles and descriptions to be more clear about alignment
1dd9d0f
to
30d7f69
Compare
Description
.spectrum-Form
cleanup and fixes (this CSS exists within the fieldlabel component)How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Regression testing
Validate:
Screenshots
Negative margin bug in prod (negative margin too large):

To-do list
I have read the contribution guidelines.
I have updated relevant storybook stories and templates.
I have tested these changes in Windows High Contrast mode.
If my change impacts other components, I have tested to make sure they don't break.
If my change impacts documentation, I have updated the documentation accordingly.
✨ This pull request is ready to merge. ✨