Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Commit

Permalink
fix(Divider): remove marginLeft from DOM element
Browse files Browse the repository at this point in the history
- fixes console warnings that Divider was throwing
- removes invalid 'marginLeft' attribute
- moves inset spacing logic into css
  • Loading branch information
petegivens authored and brad-decker committed Mar 15, 2018
1 parent 2bd044d commit 091e1ec
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/components/Divider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ import styled from 'styled-components';

export const Divider = styled.hr.attrs({
'data-smc': 'Divider',
marginLeft: ({ inset }) => {
let realInset = inset;
if (typeof realInset === 'number') realInset = `${inset}px`;
if (!realInset) return '0px';
return typeof realInset === 'string' ? realInset : '16px';
},
})`
border: none;
background-color: rgba(0, 0, 0, .12);
background-color: rgba(0, 0, 0, 0.12);
height: 1px;
margin-top: 0px;
margin-bottom: 0px;
margin-right: 0px;
margin-left: ${props => props.marginLeft};
`;
margin-left: ${({ inset }) => {
let realInset = inset;
if (typeof realInset === 'number') realInset = `${inset}px`;
if (!realInset) return '0px';
return typeof realInset === 'string' ? realInset : '16px';
}};
`;

0 comments on commit 091e1ec

Please sign in to comment.