feat(fuselage): Update input pseudo states - #2162
Open
abhinavkrin wants to merge 2 commits into
Open
Conversation
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
🦋 Changeset detectedLatest commit: 3523166 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The input pseudo state token changes alter placeholder, value, disabled and border colours across the input stories. Regenerated in the Playwright Docker image; 15 baselines changed, all colour-only with no layout shift. Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed changes (including videos or screenshots)
Updates the pseudo states of the input components to match the design spec.
font-hintand value textfont-titles-labels. The placeholder previously usedfont-annotation, which is ~2.6:1 against white and fails WCAG AA;font-hintis ~4.7:1 and passes. The value colour was darkened alongside it to keep the contrast relationship.font-disabledinstead offont-default, so disabled text is now visually distinct from enabled text.on-hoverhook already existed in the shared input primitive but resolved to the same colour as the resting border, so hovering was a no-op. It now resolves tostroke-dark.Two related fixes found while working through the states matrix:
active-border-colorused the lighterstroke-medium, so pressing made the border lighter than hover, and an invalid input dropped its red border entirely while pressed.::placeholderrule inInputBox/mixins.scsshad been commented out behind a "fix placeholder performance issue" TODO since 2019, so native placeholders rendered in the browser's default colour and no placeholder token ever reached them. It is re-enabled; under plain SCSS it compiles to 8 rules totalling ~2.3KB.Because
InputBoxis the base for the whole input family, the token changes apply to Select, MultiSelect, AutoComplete and PaginatedSelect as well. Those components set some colours from JSX props rather than the shared mixins, so five hardcodeddefaultvalues were swapped totitles-labelsto keep them consistent.Issue(s)
CORE-2375
Further comments
A few token pairs now resolve to the same value. These are intentional, not oversights:
focus-icon-colorequals the base text colour, because the ticket asks that icons follow the font colour "always" and the design file shows a dark icon in the focus row.hover-border-colorandactive-border-colorare bothstroke-dark, andinvalid-active-border-colormatches the invalid border. The design file has no pressed state, and the alternative was letting a press downgrade the state the user is already in.Known and deliberately out of scope, both pre-existing:
Select/AutoCompletedoes not dim its value text.Box'scolorprop emits!important, so the disabled token cannot win by specificity; fixing it means removing those props and wiring the tokens through.rcx-select. Worth its own PR.with-icon-addon-colorson.rcx-selectemits sibling selectors while the addon is a descendant, so it never matches, and.rcx-autocomplete__addonhas no rule at all.Visual regression: run locally in the Playwright Docker image. 15 baselines changed, all of them input stories, and they are committed here. Every diff is colour-only, with identical image dimensions before and after, so there is no layout shift. The full suite is green at 506 passed.
Downstream note: the equivalent placeholder colour in Rocket.Chat's
MessageComposerInputis hardcoded tofont-annotationand should move tofont-hintwhen the version is bumped.CORE-2375