-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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-infra] Fix missing button aria-label #40394
Conversation
Netlify deploy previewhttps://deploy-preview-40394--material-ui.netlify.app/ Bundle size report |
87a9dd7
to
ad08576
Compare
ad08576
to
4f42e4b
Compare
@@ -228,6 +227,7 @@ function ApiItem(props: ApiItemProps) { | |||
<IconButton | |||
onClick={() => setIsExtended((prev) => !prev)} | |||
className="MuiApi-expend-button" | |||
aria-label={isExtended ? 'Collapse' : 'Expand'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix.
The rest is to sync the code with the baseline convention.
export const getHash = ({ componentName, className }: HashParams) => | ||
`${componentName ? `${componentName}-` : ''}classes-${className}`; | ||
export function getHash({ componentName, className }: HashParams) { | ||
return `${componentName ? `${componentName}-` : ''}classes-${className}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this logic.
It feels weird when reading https://mui.com/material-ui/api/dialog/#Dialog-classes-paper.
I think https://mui.com/material-ui/api/dialog/#.MuiDialog-paper would be for the best DX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote it with the goal of having unique id
in mind. So I went with the strategy:
id = [componentName]-[listType]-[lineName]
The extreme case is the base API pages where multiple components are documented in a single web page. Here for example are two instance of .Mui-expanded
in the same page:
https://mui.com/base-ui/react-menu/components-api/#MenuButton-classes-expanded
https://mui.com/base-ui/react-menu/components-api/#Menu-classes-expanded
Make me realise the navigation is broken for css classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, I forgot about these global class names 🤦♂️, they are not unique.
Make me realise the navigation is broken for css classes
I saw the same thing, fixed in #40395
export const getHash = ({ componentName, className }: HashParams) => | ||
`${componentName ? `${componentName}-` : ''}classes-${className}`; | ||
export function getHash({ componentName, className }: HashParams) { | ||
return `${componentName ? `${componentName}-` : ''}classes-${className}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote it with the goal of having unique id
in mind. So I went with the strategy:
id = [componentName]-[listType]-[lineName]
The extreme case is the base API pages where multiple components are documented in a single web page. Here for example are two instance of .Mui-expanded
in the same page:
https://mui.com/base-ui/react-menu/components-api/#MenuButton-classes-expanded
https://mui.com/base-ui/react-menu/components-api/#Menu-classes-expanded
Make me realise the navigation is broken for css classes
Fix a small issue reported in https://pagespeed.web.dev/analysis/https-mui-com-base-ui-react-popper-components-api/enf7e9ejj5?form_factor=desktop