mui / base-ui

Base UI is an open-source library of accessible, unstyled UI components for React.
https://mui.com/base-ui/
MIT License
230 stars 42 forks source link

[docs] Restore documentation for states CSS customizations #543

Open oliviertassinari opened 1 month ago

oliviertassinari commented 1 month ago

Steps to reproduce

  1. Open https://master--base-ui.netlify.app/base-ui/react-switch/

Current behavior

No documentation on the different DOM states that can be customized, e.g. [data-disabled]

Expected behavior

Clear API documentation on the CSS API that is available to customize the component. https://mui.com/base-ui/react-switch/components-api/#switch-classes

Context

This is a regression from the DX with @mui/base / @mui/material. Those new states are not automatically documented anymore.

I saw this raised in https://mui-org.slack.com/archives/C05SBSU8NPR/p1723629104973729?thread_ts=1723628372.562069&cid=C05SBSU8NPR.


As a side note, there are also considerations to have with the performance of this new approach: https://mui-org.slack.com/archives/C05SBSU8NPR/p1723640921594739?thread_ts=1723628372.562069&cid=C05SBSU8NPR

SCR-20240817-qjxk

https://www.youtube.com/watch?v=nWcexTnvIKI

Benchmarks

SCR-20240819-rqrs

Your environment

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: -

michaldudak commented 4 weeks ago

We're aware the documentation is lacking in this regard. We're going to update it before the stable release.

oliviertassinari commented 4 weeks ago

@michaldudak cool, no urgency on fixing this, but I wanted to flag the need to design this in a way that we can eventually automatically document. If we can't, then I think to design differently.