Skip to content

fix(textfield): remove extra padding on nested label and help #2519

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

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

jawinn
Copy link
Collaborator

@jawinn jawinn commented Feb 13, 2024

Description

Previously some styles were adding a small amount of extra inline-start padding to the label and help text, when they are nested within Text field (as shown on the docs page for Text field). This was particularly noticeable on the quiet variation—see screenshot.

It looks like this previously was adding padding that matched the amount of corner rounding, so the label text would start where the corner started its curve.

On the design, there is no additional left padding. This update removes that padding to adhere to the design.

This also includes a small Storybook fix for the alignment of the valid checkmark. Due to recent Icon fixes, it was necessary to specify the icon set as "ui" in some of the args.

CSS-674

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 @jenndiaz

  • There is no additional inline-start padding on the label and help text within the docs for Textfield non-quiet variants
  • There is no additional inline-start padding on the label and help text within the docs for Textfield quiet variants

Regression testing

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Note: Variations of Text field, including with a Field label, are not currently well represented in Chromatic/VRT, but there are already improvements to this coming in PR #2380 .

Screenshots

Design:
design-reference

Previous behavior:
previous-behavior

Screenshot 2024-02-13 at 3 08 36 PM

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • If my change impacts other components, I have tested to make sure they don't break.
  • ✨ This pull request is ready to merge. ✨

Copy link
Contributor

github-actions bot commented Feb 13, 2024

File metrics

Summary

Total size: 3.93 MB*
Total change (Δ): ⬇ 0.74 KB (-0.02%)
Table reports on changes to a package's main file. Other changes can be found in the collapsed "Details" below.

Package Size Δ
textfield 38.35 KB ⬇ 0.25 KB
Details

textfield

File Head Base Δ
index-base.css 37.42 KB 37.66 KB ⬇ 0.25 KB (-0.64%)
index-theme.css 1.52 KB 1.52 KB -
index-vars.css 38.35 KB 38.60 KB ⬇ 0.25 KB (-0.63%)
index.css 38.35 KB 38.60 KB ⬇ 0.25 KB (-0.63%)
mods.json 2.96 KB 2.96 KB -
themes/express.css 1.05 KB 1.05 KB -
themes/spectrum.css 1.05 KB 1.05 KB -
* Size determined by adding together the size of the main file for all packages in the library.
* Results are not gzipped or minified.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

Copy link
Contributor

github-actions bot commented Feb 13, 2024

🚀 Deployed on https://pr-2519--spectrum-css.netlify.app

@jawinn jawinn added the run_vrt For use on PRs looking to kick off VRT label Feb 13, 2024
@jawinn jawinn changed the title fix(textfield): remove extra padding on nested label fix(textfield): remove extra padding on nested label and help Feb 13, 2024
Copy link
Contributor

@jenndiaz jenndiaz left a comment

Choose a reason for hiding this comment

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

Looks good to me, nice catch 🎣

@castastrophe castastrophe force-pushed the jawinn/css-674-extra-textfield-padding branch from a6cde0c to dec0ed9 Compare February 16, 2024 16:39
@castastrophe castastrophe enabled auto-merge (squash) February 16, 2024 16:39
There were styles that were adding extra inline start padding to the
label and help text, when they are nested within Textfield (as shown on
the docs page for Textfield). This was particularly noticeable on the
quiet variation.

It looks like this previously was adding padding that matched the amount
of corner rounding, so text would start where the corner started its
curve.

On the design, there is no additional left padding. This update removes
that padding to adhere to the design.
Define the icon set used for the valid and invalid icons in Textfield.

This necessary story update was related to recent fixes to icon that
addressed the fact that icons with the same name exist in both
icon sets. This one wasn't caught in VRTs because Textfield does not
have a kitchen sink style story yet to represent all of its states.
@pfulton pfulton force-pushed the jawinn/css-674-extra-textfield-padding branch from dec0ed9 to 551ab69 Compare February 16, 2024 19:55
@castastrophe castastrophe merged commit 0250d0e into main Feb 16, 2024
@castastrophe castastrophe deleted the jawinn/css-674-extra-textfield-padding branch February 16, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run_vrt For use on PRs looking to kick off VRT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants