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

Enable responsive syntax for all of <Box>'s style props #10890

Conversation

jesstelford
Copy link
Contributor

@jesstelford jesstelford commented Oct 5, 2023

Depends on #10489

This PR:

@jesstelford jesstelford changed the base branch from next to grid-responsive-props-10484 October 5, 2023 07:39
@jesstelford jesstelford changed the title responsive props not use breakpoint Enable responsive syntax for all of <Box>'s style props Oct 5, 2023
@jesstelford jesstelford force-pushed the responsive-props-not-use-breakpoint branch 3 times, most recently from e777305 to acb1bcc Compare October 5, 2023 09:59
Comment on lines +13 to +36
@include responsive-props('box', 'background', 'background-color');
@include responsive-props('box', 'border-block-end-width', 'border-block-end-width', ('xs': 0));
@include responsive-props('box', 'border-block-start-width', 'border-block-start-width', ('xs': 0));
@include responsive-props('box', 'border-color', 'border-color');
@include responsive-props('box', 'border-end-end-radius', 'border-end-end-radius');
@include responsive-props('box', 'border-end-start-radius', 'border-end-start-radius');
@include responsive-props('box', 'border-inline-end-width', 'border-inline-end-width', ('xs': 0));
@include responsive-props('box', 'border-inline-start-width', 'border-inline-start-width', ('xs': 0));
@include responsive-props('box', 'border-start-end-radius', 'border-start-end-radius');
@include responsive-props('box', 'border-start-start-radius', 'border-start-start-radius');
@include responsive-props('box', 'border-style', 'border-style');
@include responsive-props('box', 'color', 'color');
@include responsive-props('box', 'inset-block-end', 'inset-block-end');
@include responsive-props('box', 'inset-block-start', 'inset-block-start');
@include responsive-props('box', 'inset-inline-end', 'inset-inline-end');
@include responsive-props('box', 'inset-inline-start', 'inset-inline-start');
@include responsive-props('box', 'max-width', 'max-width');
@include responsive-props('box', 'min-height', 'min-height');
@include responsive-props('box', 'min-width', 'min-width');
@include responsive-props('box', 'outline-color', 'outline-color');
@include responsive-props('box', 'outline-style', 'outline-style');
@include responsive-props('box', 'outline-width', 'outline-width');
@include responsive-props('box', 'overflow-x', 'overflow-x');
@include responsive-props('box', 'overflow-y', 'overflow-y');
Copy link
Member

@aaronccasanova aaronccasanova Oct 5, 2023

Choose a reason for hiding this comment

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

I'm all for this update! Might be a good opportunity to revisit my comment on the original implementation. Thoughts?

#7697 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oooh, yes, love it! Let's get that into a fast-follow PR 👍

There's also an opportunity to optimize it even further by not even outputting a media query if that value is just going to fallback to an earlier breakpoint's value anyway.

@jesstelford jesstelford force-pushed the grid-responsive-props-10484 branch 2 times, most recently from 9ede084 to aa81906 Compare October 6, 2023 05:58
@jesstelford jesstelford force-pushed the responsive-props-not-use-breakpoint branch from acb1bcc to 3cbf209 Compare October 6, 2023 06:03
Copy link
Contributor

@laurkim laurkim left a comment

Choose a reason for hiding this comment

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

Looks great overall! 💯
Noticing some regressions with text when running locally though where the color isn't being set properly. That might be what's causing the large amount of baseline changes that need to be accepted for Storybook.

@jesstelford
Copy link
Contributor Author

jesstelford commented Oct 7, 2023

@laurkim Good catch! I realised it was to do with initial vs inherit, and fixed that issue in #10489 (comment) (along with an explanation of the fix), then rebased this branch on top so it inherits that fix 👍

Will watch to see if Chromatic shows fewer changes now 🤞

EDIT: Yep, that worked 🎉 The "19 changes" showing at the moment are from the base branch. See more details here.

Copy link
Contributor

Hi! We noticed there hasn’t been activity on this PR in a while. After 30 days, it will close automatically.

If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed.

@aaronccasanova aaronccasanova force-pushed the responsive-props-not-use-breakpoint branch from 731328a to f3a65b2 Compare April 19, 2024 21:52
@github-actions github-actions bot closed this May 20, 2024
@jesstelford jesstelford reopened this May 20, 2024
responsiveProp: ResponsiveProp<Input> | undefined,
fn: (value?: Input) => Output | undefined,
): ResponsiveProp<Output> | undefined {
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the commented out code on lines 177-182 and 219-227?

@github-actions github-actions bot closed this Jun 20, 2024
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.

None yet

3 participants