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

feat(grid): add column padding helper class #5449

Merged
6 changes: 6 additions & 0 deletions packages/components/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,12 @@ Generate the CSS for a grid for the given breakpoints and gutters
@include carbon--make-row();
}

.#{$prefix}--row-padding [class*='#{$prefix}--col'],
.#{$prefix}--col-padding {
padding-top: $grid-gutter / 2;
padding-bottom: $grid-gutter / 2;
}

.#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
padding-top: $condensed-gutter / 2;
padding-bottom: $condensed-gutter / 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ em {
margin-right: -1rem;
margin-left: -1rem; }

.bx--row-padding [class*='bx--col'],
.bx--col-padding {
padding-top: 1rem;
padding-bottom: 1rem; }

.bx--grid--condensed [class*='bx--col'] {
padding-top: 0.0625rem;
padding-bottom: 0.0625rem; }
Expand Down
6 changes: 6 additions & 0 deletions packages/elements/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,12 @@ Generate the CSS for a grid for the given breakpoints and gutters
@include carbon--make-row();
}

.#{$prefix}--row-padding [class*='#{$prefix}--col'],
.#{$prefix}--col-padding {
padding-top: $grid-gutter / 2;
padding-bottom: $grid-gutter / 2;
}

.#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
padding-top: $condensed-gutter / 2;
padding-bottom: $condensed-gutter / 2;
Expand Down
6 changes: 6 additions & 0 deletions packages/grid/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,12 @@ Generate the CSS for a grid for the given breakpoints and gutters
@include carbon--make-row();
}

.#{$prefix}--row-padding [class*='#{$prefix}--col'],
.#{$prefix}--col-padding {
padding-top: $grid-gutter / 2;
padding-bottom: $grid-gutter / 2;
}

.#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
padding-top: $condensed-gutter / 2;
padding-bottom: $condensed-gutter / 2;
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/examples/preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"develop": "parcel index.html --no-cache"
},
"devDependencies": {
"parcel-bundler": "^1.10.0-beta.1"
"parcel-bundler": "^1.12.4"
},
"dependencies": {
"@reach/router": "^1.2.1",
Expand Down
55 changes: 55 additions & 0 deletions packages/grid/examples/preview/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,61 @@ const sections = [
</div>
),
},
{
name: 'Include column padding',
description:
'Use the column padding helper to add vertical padding to a node in a column',
content() {
return (
<div className="bx--grid">
<div className="bx--row">
<div className="bx--col bx--col-padding">
<div className="outside">
<div className="inside">1/4</div>
</div>
</div>
<div className="bx--col">
<div className="outside bx--col-padding">
<div className="inside">1/4</div>
</div>
</div>
<div className="bx--col bx--col-padding">
<div className="outside">
<div className="inside">1/4</div>
</div>
</div>
<div className="bx--col bx--col-padding">
<div className="outside">
<div className="inside">1/4</div>
</div>
</div>
</div>
<div className="bx--row bx--row-padding">
<div className="bx--col">
<div className="outside">
<div className="inside">1/4</div>
</div>
</div>
<div className="bx--col">
<div className="outside">
<div className="inside">1/4</div>
</div>
</div>
<div className="bx--col">
<div className="outside">
<div className="inside">1/4</div>
</div>
</div>
<div className="bx--col">
<div className="outside">
<div className="inside">1/4</div>
</div>
</div>
</div>
</div>
);
},
},
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/examples/preview/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../scss/grid';
@import '../../scss/index';

*,
*::before,
Expand Down
Loading