Skip to content

Instantly share code, notes, and snippets.

@kevinfelisilda
Created April 14, 2019 12:30
Show Gist options
  • Save kevinfelisilda/8ccc125f284d3565ba09f1a6b804291f to your computer and use it in GitHub Desktop.
Save kevinfelisilda/8ccc125f284d3565ba09f1a6b804291f to your computer and use it in GitHub Desktop.
// yarn add styled-components
import styled from 'styled-components';
export default function() => {
return (
<Style>
<div className="blue">
This is blue text
</div>
<div className="parent">
This is a parent element
<div className="child">
This is a child element (red color)
</div>
</div>
<div className="child">
This is another .child element but normal color;
</div>
</Style>
);
}
const Style = styled.div`
.blue {
color: blue;
}
.parent {
display: block;
background: #eee;
.child {
color: red;
}
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment