-
Notifications
You must be signed in to change notification settings - Fork 2.9k
chore: Update Input to use makeResetStyles #26815
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
Conversation
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
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 88e04372fc18f70429c015293f2370097a966374 (build) |
Collaborator
📊 Bundle size reportUnchanged fixtures
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit acf8705:
|
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 1319 | 1346 | 5000 | |
| Button | mount | 929 | 938 | 5000 | |
| Field | mount | 2048 | 2057 | 5000 | |
| FluentProvider | mount | 1642 | 1627 | 5000 | |
| FluentProviderWithTheme | mount | 636 | 629 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 595 | 595 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 628 | 626 | 10 | |
| InfoButton | mount | 565 | 557 | 5000 | |
| MakeStyles | mount | 1900 | 1928 | 50000 | |
| Persona | mount | 3011 | 2978 | 5000 | |
| SpinButton | mount | 2560 | 2499 | 5000 |
khmakoto
approved these changes
Feb 11, 2023
packages/react-components/react-input/src/components/Input/useInputStyles.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-input/src/components/Input/useInputStyles.ts
Show resolved
Hide resolved
packages/react-components/react-input/src/components/Input/useInputStyles.ts
Outdated
Show resolved
Hide resolved
Collaborator
🕵 fluentuiv9 No visual regressions between this PR and main |
spmonahan
approved these changes
Feb 14, 2023
spmonahan
reviewed
Feb 14, 2023
packages/react-components/react-input/src/components/Input/useInputStyles.ts
Show resolved
Hide resolved
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.

Previous Behavior
Input styles were written before griffel's
makeResetStyleswas available.New Behavior
Refactor the Input component's styles to use griffel reset styles for the base styles on each slot.
Move the styles for some of the default states (enabled; size=medium; appearance=outline) into the reset styles. In some cases, this required updating the per-state overrides: for example, previously appearance=underline added a single bottom border; but now it removes the top/left/right borders because the base styles include all of the borders.
There are two different reset style classes for the root slot. When enabled (aka "interactive"), Input adds a large number of styles to account for the focus visuals. However, those styles aren't present for the disabled state. useInputStyles picks between the two reset styles,
useRootInteractiveClassNameoruseRootNonInteractiveClassName, based on whether it's enabled.This significantly reduces the number of classNames applied to the slots of Input. Here are some counts of classNames added (sum of classNames on all slots of Input) for some of the examples on storybook for Input.