Skip to content

feat(design-system): create reusable helper function to support responsive styling [AR-53842]#338

Open
vpolessky-dn wants to merge 7 commits intodrivenets:mainfrom
vpolessky-dn:feat/AR-53842-create-reusable-helper-function-to-support-responsive-styling
Open

feat(design-system): create reusable helper function to support responsive styling [AR-53842]#338
vpolessky-dn wants to merge 7 commits intodrivenets:mainfrom
vpolessky-dn:feat/AR-53842-create-reusable-helper-function-to-support-responsive-styling

Conversation

@vpolessky-dn
Copy link
Copy Markdown
Collaborator

No description provided.

children,
...props
}) => {
const size = useResponsiveValue(sizeProp);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We rely on JS to choose the size based on the screen width. Using CSS media queries would be cheaper form performance standpoint.
I think useResponsiveValue hook is equivalent of MUI useMediaQuery and is usefull when you have some conditional rendering etc. We should expose it for library consumers.
If we want to follow MUI, then responsive props → generate CSS media queries. It may be hard, because it requires runtime css / css pre-processors. I'm not saying we 100% need it. I want to make sure we discuss this option and are on the same page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants