Skip to content

Instantly share code, notes, and snippets.

@drenther
Last active June 24, 2018 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drenther/d808acd10aeb9f554adfccdd98b95d30 to your computer and use it in GitHub Desktop.
Save drenther/d808acd10aeb9f554adfccdd98b95d30 to your computer and use it in GitHub Desktop.
pseudo-selector usage in styled-components
/* index.js */
/* line 11 - 31 */
.
.
.
`* {
border: none;
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body,
#root {
height: 100%;
width: 100%;
}
a,
a:hover,
a:active,
a:visited {
text-decoration: none;
color: inherit;
}`;
.
.
.
/* src/User.js */
.
.
.
/* line 40 - 57 */
export default styled(User)`
width: 280px;
margin: 10px;
padding: 10px;
border: solid 2px ${getColor('secondary')};
border-radius: 70px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: flex-start;
transition: all 0.25s ease-in;
position: relative;
background: ${getColor('secondary')};
&:hover {
transform: scale(1.05);
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment