-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
* chore(documentation): grid dockblocks * chore(grids): remove mixins, move deprecated styles to deprecate file and include * feat(grids): Add docblocks part 1 * Continue * chore(grids): Finish documentation * Remove Example wrapper for now * feat(grids): Fix linting errors * Add missing sections, fix build * Remove comment * Add tests * Add tests * Updated documentation text * Update blockquote text * Update snapshot refs * Update headings
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,10 @@ p.doc { | |
margin-bottom: 1.5rem; | ||
} | ||
|
||
p.doc:first-child { | ||
margin-top: 0; | ||
} | ||
|
||
a.doc { | ||
color: #0070d2; | ||
} | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved | ||
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license | ||
|
||
import React, { Component } from 'react'; | ||
import CodeView from '../../../../shared/components/CodeView'; | ||
import style from './Grid.scss'; | ||
import classNames from 'classnames'; | ||
|
||
export const Column = props => { | ||
let count = props.count + 1; | ||
return ( | ||
<div className={classNames('slds-col', props.className)}> | ||
{props.count >= 0 ? <span>{count}</span> : <span>{props.children}</span>} | ||
</div> | ||
); | ||
}; | ||
|
||
class Grid extends Component { | ||
render() { | ||
const children = []; | ||
for (var i = 0; i < this.props.columns; i += 1) { | ||
children.push({ key: i, count: i }); | ||
} | ||
return ( | ||
<div | ||
className={classNames( | ||
'simple-grid', | ||
this.props.small && 'simple-grid_small' | ||
)} | ||
> | ||
<CodeView> | ||
<div | ||
className={classNames('slds-grid', this.props.className)} | ||
style={this.props.style} | ||
> | ||
{this.props.columns | ||
? children.map(props => <Column key={props.key} {...props} />) | ||
: this.props.children} | ||
</div> | ||
</CodeView> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Grid; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// stylelint-disable selector-class-pattern | ||
.simple-grid .slds-grid { | ||
height: 8.75rem; | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.simple-grid_small .slds-grid { | ||
height: auto; | ||
} | ||
|
||
.simple-grid .slds-grid > .slds-grid { | ||
height: auto; | ||
margin-bottom: 0; | ||
} | ||
|
||
.simple-grid .slds-col { | ||
display: inline-flex; | ||
background: #54698d; | ||
color: #fff; | ||
text-align: center; | ||
background-clip: content-box; | ||
border: 1px solid #fff; | ||
border-radius: 0; | ||
} | ||
|
||
.simple-grid .slds-col > span { | ||
align-self: center; | ||
margin: auto; | ||
font-size: 1.575rem; | ||
padding: 0.5rem; | ||
} | ||
|
||
.simple-grid .slds-wrap { | ||
align-items: stretch; | ||
} | ||
|
||
.simple-grid__buttons { | ||
margin: auto; | ||
} |