-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(HelperClasses): add breakpoint helper classes #11786
feat(HelperClasses): add breakpoint helper classes #11786
Conversation
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
a955d91
to
54e9ab2
Compare
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 think it makes sense to have a place like this for helper classes to live. A few thoughts:
- Does it make sense to document these in an elements example instead of storybook?
- Do we need to expose these via React Components? (Assuming no)
- Should these be within a mixin (or maybe a mixin per-class?) so they're easier to compose within existing classes a product might have?
// use a single helper via mixins?
@use '@carbon/styles/scss/utilities/helper-classes';
.my-class {
@include helper-classes.hide-at-sm();
}
// emit "hidden" helper classes and make them all available to this module via one big mixin?
@use '@carbon/styles/scss/utilities/helper-classes';
@include helper-classes.hidden();
I don't have a preference here, but since it lives in the style package I just put it in the storybook.
I don't think so
Good thinking, I think making them available as mixins fits better with the way we ship other helper utilities. I prefer the mixin per class approach, I can push up a PR with those changes so we can take a look |
d479160
to
6ca4ba2
Compare
@tay1orjones I've just pushed some changes to move this to its own file called |
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.
One small thing, otherwise looks good to me!
88dfe09
to
f75988f
Compare
e4e9884
to
3b9c5ef
Compare
Closes #2435
This PR adds in classes that can be used to hide elements only at specific breakpoints. This can already be done with the 0 column span grid classes, but this specifically addresses the need for this outside of a grid.
This is a PoC for a potential "Helper Classes" file that lives inside the
utilities
section of ourscss
package. We've gotten other requests for simple helper classes in the past, and this would give them a place to live. Would love to know what everyone thinks.None of the classnames/filenames are set in stone and would love feedback.
For now, you can view the example in the storybook under the
Helpers
section at the bottom of the list.Changelog
New
Changed
Removed
Testing / Reviewing
{{ Add descriptions, steps or a checklist for how reviewers can verify this PR works or not }}