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

flex box mixin #2077

Merged
merged 2 commits into from
Feb 5, 2018
Merged

flex box mixin #2077

merged 2 commits into from
Feb 5, 2018

Conversation

giladgray
Copy link
Contributor

sweet pt-flex-container($dir, $margin, $inline, $fill) mixin does it all!

@adidahiya this is the base branch for other flex PRs, but currently it contains just the code for the flex mixin so we can review that separately from the PRs that use it.

@blueprint-bot
Copy link

sweet pt-flex-container mixin

Preview: documentation | landing | table

@blueprint-bot
Copy link

break margin logic into default, last

Preview: documentation | landing | table

// applies margin along axis of direction between every direct child, with no margins on either end.
// $direction: row | column
// $margin: margin[-right|-bottom] value
@mixin pt-flex-margin($direction, $margin) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this whole thing inspired by "Spacing children" section on https://typestyle.github.io/#/box.
I used a similar pattern to great success in recent app development: huge reduction in layout headaches when you apply spacing to all children at the container level.

Copy link
Contributor

Choose a reason for hiding this comment

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

super neat. since we don't export Sass functions/mixins, what do you think about providing utility classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we do expose these sass functions... we ship all the original .scss files.
i'd be open to adding classes, but that can be done additively later. it's tricky cuz the mixin takes a bunch of parameters, but classes are static styles so we'd have to choose defaults (less flexible) or provide many classes (unwieldy).

@giladgray giladgray changed the title [WIP] Flex box mixin flex box mixin Feb 5, 2018
@giladgray giladgray merged commit 1e2257a into develop Feb 5, 2018
@adidahiya adidahiya deleted the flex-containers branch February 5, 2018 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants