Skip to content

Instantly share code, notes, and snippets.

@cogell
Created April 8, 2018 18:27
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 cogell/1004b3c3bb6ff58d035093bc09923ff3 to your computer and use it in GitHub Desktop.
Save cogell/1004b3c3bb6ff58d035093bc09923ff3 to your computer and use it in GitHub Desktop.
Quick Styled-Components Interactions
import ColorUtils from './colors';
const interactive = (attr, color) =>
`
&:hover {
${attr}: ${ColorUtils.hover(color)};
}
&:active {
${attr}: ${ColorUtils.active(color)};
}
&:focus {
${attr}: ${ColorUtils.focus(color)};
}
&:disabled {
${attr}: ${ColorUtils.disabled(color)};
}
${attr}: ${color};
`;
export default interactive;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment