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

v9 shared form control styles: Input, Select, Combobox, Textarea #22231

Closed
smhigley opened this issue Mar 28, 2022 · 4 comments
Closed

v9 shared form control styles: Input, Select, Combobox, Textarea #22231

smhigley opened this issue Mar 28, 2022 · 4 comments

Comments

@smhigley
Copy link
Contributor

Ref: https://github.com/microsoft/fluentui/pull/21068/files#r829433773

We have a number of shared styles and shared style constants (e.g. padding, animation timing, etc.) across Input, Select, Combobox, and Textarea. It would make sense to share those styles somewhere centralized, but we'd need to figure out where.

Existing considerations:

  • Focus styles were added to react-tabster in Textarea: Adding implementation #22096. I think this is worth revisiting, since while it does centralize the shared focus style, it also bakes a lot of very theme-specific styles into react-tabster, even with the passed-in options.
  • We have both shared styles (e.g. the focus indicator) and also shared constants (the input padding, for instance)
  • Some of the shared constants are defined in the react-text package, but are not exported (see Select vNext styles #21068 (comment) for more context)
@smhigley
Copy link
Contributor Author

Also SpinButton :)

@sopranopillow
Copy link
Contributor

Focus indicator styles

For reference, we talked about having these possibilities in a sync:

  • Using box-shadow instead of having ::after. This was brought up because if we were to use box-shadow, we wouldn't need to use ::after and won't be rendered in WHCM.
  • Improving the current tabster useFocusIndicatorStyle to allow for all these variants to live in a single hook. This will avoid having to add new custom indictor hooks over and over.
  • Keep it as is and have the duplicated code since these are very theme-specific styles as mentioned above.

@GeoffCoxMSFT
Copy link
Member

FYI - I'll use this issue for PRs to add the spacing, duration, and curve tokens as well as the contentsize constants, but won't close the issue.

@GeoffCoxMSFT
Copy link
Member

@sopranopillow - We already have the shared tokens being used. Coastal consensus is that trying to share this now is a bit early given that the hooks composition model doesn't have style sharing (yet), other libraries take a base-component composition approach, and it is unclear where this shared style would live. Pls close this if you agree.

Repository owner moved this from Todo to Done in @fluentui/react-components v9.0.0 Jun 8, 2022
@microsoft microsoft locked as resolved and limited conversation to collaborators Jul 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

No branches or pull requests

3 participants