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

docs: pros & cons for dynamic variations when customizing #21152

Closed
dandv opened this issue May 23, 2020 · 6 comments
Closed

docs: pros & cons for dynamic variations when customizing #21152

dandv opened this issue May 23, 2020 · 6 comments
Labels
docs Improvements or additions to the documentation

Comments

@dandv
Copy link
Contributor

dandv commented May 23, 2020

On the Customizing components page, under 2. Dynamic variation for a one-time situation, the docmentation reads,

You have learned how to override the style of a Material-UI component in the previous section. Now, let's see how we can make these overrides dynamic. Here are five alternatives; each has it's pros and cons.

What are these pros and cons?

@oliviertassinari
Copy link
Member

oliviertassinari commented May 24, 2020

  • Dynamic CSS
    • pros: use the same syntax
    • cons: slower
  • Class name branch
    • pros: avoid the above
    • cons: force to isolate states+
  • CSS variables
    • pros: propagate instantly, faster
    • cons: no older browser support, fewer variable manipulation capability
  • Inline-styles
    • pros: fast
    • cons: limited features, compared to CSS
  • Theme nesting
    • pros: quick and dirty
    • cons: discourged.

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label May 24, 2020
@dandv
Copy link
Contributor Author

dandv commented May 24, 2020

Thanks! Should I add these to the docs, spread out to each method, or do you have other plans to link to this information?

@oliviertassinari
Copy link
Member

I have been wondering about this when first introducing the different options. I went on the conclusion that new users would pick the first one (no need for pros/cons) and that advanced users would be interested to have their perspective broadened (no need for pros/cons).

Now, there is likely a middle ground here. The main challenge is to accurately explain the pros and cons.

@oliviertassinari
Copy link
Member

Closing as I believe it's not important

@dandv
Copy link
Contributor Author

dandv commented May 30, 2020

new users would pick the first one (no need for pros/cons)

I'm a new user who likes to make informed choices. I never just pick the first option without understanding why. Maybe if I didn't care, and the docs said something like "in most cases you'll want to go with #1", then yes. But otherwise, with just a list of options and no guidance, how would I distinguish a list of 5 equally good options, from a list of 5 where the first is much better in most situations?

@oliviertassinari
Copy link
Member

oliviertassinari commented May 30, 2020

Agree, we can do better, what I meant is that it's a low ROI problem, better ignoring it to focus on something with more leverage (opportunity cost).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants