Skip to content

Commit

Permalink
Merge pull request #27 from nordnet/noPadding-on-grid
Browse files Browse the repository at this point in the history
feat: noPadding on grid
  • Loading branch information
mlenser committed Mar 19, 2018
2 parents b9702bf + e29f9ce commit f5b79f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/col/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function Col({
className: classNameCustom,
children,
componentClass: ComponentClass,

reverse,
xs,
sm,
Expand Down Expand Up @@ -56,16 +55,12 @@ function Col({
[classes['sm-last']]: smLast,
[classes['md-last']]: mdLast,
[classes['lg-last']]: lgLast,
[classes['noPadding']]: noPadding,
[classes.noPadding]: noPadding,
},
classNameCustom,
);

return (
<ComponentClass className={className}>
{children}
</ComponentClass>
);
return <ComponentClass className={className}>{children}</ComponentClass>;
}

Col.propTypes = {
Expand Down
3 changes: 3 additions & 0 deletions src/grid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ function Grid({
style,
children,
componentClass: ComponentClass,
noPadding,
}) {
const className = cn(
{
[classes.grid]: !fluid,
[classes.gridFluid]: fluid,
[classes.noPadding]: noPadding,
},
classNameCustom,
);
Expand All @@ -35,6 +37,7 @@ Grid.propTypes = {
style: PropTypes.object,
children: PropTypes.node,
componentClass: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
noPadding: PropTypes.bool,
};

Grid.defaultProps = {
Expand Down
3 changes: 3 additions & 0 deletions src/grid/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const styles = {
boxSizing: 'border-box',
margin: '0 auto',
},
noPadding: {
padding: 0,
},
};

Object.keys(breakpoints).forEach(breakpoint => {
Expand Down

0 comments on commit f5b79f4

Please sign in to comment.