Skip to content

Commit a095cba

Browse files
author
Ayesha Mazumdar
authored
fix(grid): Add documentation for col bump classes (#3193)
1 parent f8f8801 commit a095cba

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

ui/utilities/grid/_doc.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* @utility
3030
* @name grid
31-
* @selector [class*='slds-grid'], [class*='slds-wrap'], [class*='slds-nowrap'], [class*='slds-gutters'], .slds-col, [class*='slds-col-'], .slds-has-flexi-truncate, .slds-no-flex, .slds-no-space, [class*='slds-grow'], [class*='slds-shrink'], [class*='slds-container']
31+
* @selector [class*='slds-grid'], [class*='slds-wrap'], [class*='slds-nowrap'], [class*='slds-gutters'], .slds-col, [class*='slds-col-'], [class*='slds-col_'], .slds-has-flexi-truncate, .slds-no-flex, .slds-no-space, [class*='slds-grow'], [class*='slds-shrink'], [class*='slds-container']
3232
* @support dev-ready
3333
* @layout responsive
3434
*/

ui/utilities/grid/docs.mdx

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,40 @@ If you want your columns to grow from the end of the horizontal axis, apply the
362362
</Grid>
363363
</Example>
364364

365+
### Content alignment with bump
366+
367+
To "bump" a single or multiple grid items, apply the class `slds-col_bump-{direction}`, with `{direction}` being either left, right, top or bottom, to a grid item.
368+
369+
**Bump Left**
370+
371+
In the example below, applying the left bump class to item 5 bumps items 1 through 4 to the left.
372+
373+
<Example title="Grid Content Alignment Bump Left">
374+
<Grid bareGrid>
375+
<div><span>1</span></div>
376+
<div><span>2</span></div>
377+
<div><span>3</span></div>
378+
<div><span>4</span></div>
379+
<div className="slds-col_bump-left"><span>5</span></div>
380+
<div><span>6</span></div>
381+
</Grid>
382+
</Example>
383+
384+
**Bump Right**
385+
386+
In the example below, applying the right bump class to item 5 bumps item 6 to the right.
387+
388+
<Example title="Grid Content Alignment Bump Right">
389+
<Grid bareGrid>
390+
<div><span>1</span></div>
391+
<div><span>2</span></div>
392+
<div><span>3</span></div>
393+
<div><span>4</span></div>
394+
<div className="slds-col_bump-right"><span>5</span></div>
395+
<div><span>6</span></div>
396+
</Grid>
397+
</Example>
398+
365399
### Reversed
366400

367401
There may be times you find yourself in a situation to reverse the visual flow of your columns, you can do this both horizontally and vertically. To reverse the horizontal flow, add the class `slds-grid_reverse` to the `slds-grid` container. To reverse the vertical flow, add the class `slds-grid_vertical-reverse` to the `slds-grid` container.
@@ -452,7 +486,7 @@ To reverse the vertical flow, add the class `slds-grid_vertical-reverse` to the
452486

453487
To specify the vertical placement of grid items on the cross axis, you can apply `slds-align-top`, `slds-align-middle`, and `slds-align-bottom` to a `slds-col` element.
454488

455-
<Example title="Grid Vertical Align inidividual">
489+
<Example title="Grid Vertical Align individual">
456490
<Grid style={{height: '200px'}}>
457491
<Column className="slds-align-top">1</Column>
458492
<Column className="slds-align-middle">2</Column>

ui/utilities/grid/docs/Grid.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class Grid extends Component {
2525
<div
2626
className={classNames(
2727
'simple-grid',
28-
this.props.small && 'simple-grid_small'
28+
this.props.small && 'simple-grid_small',
29+
this.props.bareGrid && 'simple-grid_bare-columns'
2930
)}
3031
>
3132
<CodeView>

ui/utilities/grid/docs/Grid.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,20 @@
3737
.simple-grid__buttons {
3838
margin: auto;
3939
}
40+
41+
.simple-grid_bare-columns .slds-grid > div {
42+
display: inline-flex;
43+
background: #54698d;
44+
color: #fff;
45+
text-align: center;
46+
background-clip: content-box;
47+
border: 1px solid #fff;
48+
border-radius: 0;
49+
}
50+
51+
.simple-grid_bare-columns .slds-grid > div > span {
52+
align-self: center;
53+
margin: auto;
54+
font-size: 1.575rem;
55+
padding: 0.5rem;
56+
}

0 commit comments

Comments
 (0)