-
Notifications
You must be signed in to change notification settings - Fork 188
Feat: responsive styles #1737
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
Feat: responsive styles #1737
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 7982153 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +736 B (+0.25%) Total Size: 290 kB
ℹ️ View Unchanged
|
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.
Looking good so far. This only works with spaces, how do you plan to extend it to work with other props?
packages/design-system/src/helpers/__tests__/handleResponsiveValues.test.ts
Outdated
Show resolved
Hide resolved
packages/design-system/src/helpers/__tests__/handleResponsiveValues.test.ts
Outdated
Show resolved
Hide resolved
packages/design-system/src/helpers/__tests__/handleResponsiveValues.test.ts
Show resolved
Hide resolved
52cebbc
to
519a0d7
Compare
90e95f2
to
63609f4
Compare
Should we remove this? design-system/docs/stories/Flex.mdx Lines 22 to 23 in c7ebedd
|
What does it do?
This PR introduces responsive props to components like
Box
,Flex
to start with. To pass responsive props on components, user has to use object notation as below,<Component padding={{initial: 2, small: 4, medium: 6, large: 8}} />
User can also pass arrays to shorthand properties like
padding
/margin
.<Component padding={{initial: [2, 4], small: 4, medium: [2, 4, 4], large: "24px" }} />
Why is it needed?
To ensure design system is responsive, read more.