Guest User

Untitled

a guest
Feb 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. # Styled utility functions package
  2.  
  3. I try and resist putting stuff in this package. But its just for overflow when theme/markup doesn't cut it, and if I CONTINUALLY reuse some styles.
  4. ## Package structure
  5.  
  6. ```
  7. .
  8. ├── defaultTheme
  9. │   └── index.js
  10. ├── index.js
  11. └── render
  12. └── index.js
  13. ```
  14.  
  15.  
  16. ## `defaultTheme.js`
  17.  
  18. ```
  19. import { setLightness } from 'polished';
  20. import c from '@project/colors';
  21.  
  22. export default {
  23. page: {
  24. background: {
  25. color: setLightness(0.9, c.brand.grey),
  26. },
  27. color: c.brand.black,
  28. colorSecondary: c.brandLight.black,
  29. },
  30. ....etc...
  31. ```
  32.  
  33. ## `render/index.js`
  34.  
  35. ```
  36. import c from '@project/colors';
  37.  
  38. export const error = ({ error = false }) => (error
  39. ? `
  40. color: ${c.brand.error};
  41. `
  42. : EMPTY);
  43.  
  44. ....etc...
  45. ```
Add Comment
Please, Sign In to add comment