Guest User

Untitled

a guest
Dec 11th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. // lib/blocks/Button/__tests__/index.js
  2.  
  3. const modifierConfig = {
  4. primary: ({ theme }) => `
  5. background-color: ${theme.colors.primary};
  6. `,
  7.  
  8. secondary: ({ theme }) => `
  9. background-color: ${theme.colors.secondary};
  10. `,
  11.  
  12. disabled: () => `
  13. opacity: 50%;
  14. pointer-events: none;
  15. `,
  16. };
  17.  
  18. const Button = styled.button`
  19. background-color: ${props => props.theme.colors.chrome500};
  20. border-radius: 2px;
  21. border: solid 1px transparent;
  22. color: ${props => props.theme.colors.chrome000};
  23. cursor: pointer;
  24. font-size: 1rem;
  25. padding: 0.5rem 1.5rem;
  26. outline: none;
  27. transition: all 200ms ease;
  28.  
  29. &:hover,
  30. &:focus {
  31. background-color: ${props => lighten(0.05, props.theme.colors.chrome500)};
  32. box-shadow: 0 8px 8px 0 ${props => rgba(props.theme.colors.chrome600, 0.4)};
  33. }
  34.  
  35. ${applyStyleModifiers(modifierConfig)}
  36. `;
Add Comment
Please, Sign In to add comment