Skip to content

Commit

Permalink
✨ feat(flex.scss): Add flex grow/shrink util classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiderpig86 committed Nov 27, 2021
1 parent f7c4862 commit 00d2d61
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
48 changes: 48 additions & 0 deletions dist/cirrus.css
Original file line number Diff line number Diff line change
Expand Up @@ -13662,6 +13662,54 @@ a.tag:hover {
align-items: baseline !important;
}
}
.u-flex-grow-0 {
flex-grow: 0 !important;
}

.u-flex-grow-1 {
flex-grow: 1 !important;
}

@media screen and (min-width: 640px) {
.u-flex-grow-0-sm {
flex-grow: 0 !important;
}
}
@media screen and (min-width: 640px) {
.u-flex-grow-1-sm {
flex-grow: 1 !important;
}
}
@media screen and (min-width: 768px) {
.u-flex-grow-0-md {
flex-grow: 0 !important;
}
}
@media screen and (min-width: 768px) {
.u-flex-grow-1-md {
flex-grow: 1 !important;
}
}
@media screen and (min-width: 1024px) {
.u-flex-grow-0-lg {
flex-grow: 0 !important;
}
}
@media screen and (min-width: 1024px) {
.u-flex-grow-1-lg {
flex-grow: 1 !important;
}
}
@media screen and (min-width: 1280px) {
.u-flex-grow-0-xl {
flex-grow: 0 !important;
}
}
@media screen and (min-width: 1280px) {
.u-flex-grow-1-xl {
flex-grow: 1 !important;
}
}
.u-gap-0 {
gap: calc(0.5rem * 0) !important;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cirrus.min.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/core/utils/flex.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ $justify-content: flex-start, center, flex-end, space-between, space-around, spa

$align-items: stretch, flex-start, center, flex-end, baseline;

$flex-grow: 0, 1;

@include generate-classes-for-viewport(
$flex-directions,
'flex-direction',
Expand All @@ -26,6 +28,14 @@ $align-items: stretch, flex-start, center, flex-end, baseline;
$generate-viewports: #{get-viewport-flag('FLEX')}
);

// Flex grow/shrink utils
@include generate-classes-for-viewport(
$flex-grow,
'flex-grow',
'u#{delimitize('flex-grow')}',
$generate-viewports: #{get-viewport-flag('FLEX')}
);

// Generate flex gap class map
$flex-gaps-both: ();
// TODO: Consider if we need to generate for row and col only
Expand Down

0 comments on commit 00d2d61

Please sign in to comment.