Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Dictionary } from 'ramda'
  2.  
  3. type AnyProps = Dictionary<any>
  4.  
  5. const colors: Dictionary<!!|<>> = {
  6.   brand: '#3677E8',
  7.   darkBrand: '#0E436D',
  8.   brand10a: 'rgba(54, 119, 232, 0.1)',
  9.   paleBrand: '#B1C9FF',
  10.   tableHeaderBg: 'rgba(247, 247, 247, 0.6)',
  11.   headerBg: '#ffffff',
  12.   mainBg: '#fafcff',
  13.   boxDefaultBg: '#ffffff',
  14.   border: '#d1d1d1',
  15.   lightGrey: '#f7f7f7',
  16.  
  17.   'status-open': '#FFCC00',
  18.   'status-draft': '#9E9FA5',
  19.   'status-paid': '#1BEB98',
  20.   'status-overdue': '#FF4D95',
  21.   'light-3': '#E5E5E5',
  22.   'light-5': '#B2B2B2',
  23.   'light-6': '#CCC',
  24.   tableHover: 'rgba(247, 247, 247, 0.6)',
  25.  
  26.   fogAndRain: '#979797',
  27.   gandalf: '#E5E5E5',
  28.   valentineRed: '#F04158',
  29.   succulentLeaf: '#66DCCF',
  30.   yellow: '#F4DD51',
  31.   teal: '#35D1BF',
  32. }
  33.  
  34. const theme = {
  35.   global: {
  36.     colors,
  37.     control: {
  38.       border: {
  39.         width: '1px',
  40.         radius: '4px',
  41.       },
  42.     },
  43.     focus: {
  44.       border: {
  45.         color: '#cccccc',
  46.       },
  47.     },
  48.     drop: {
  49.       border: {
  50.         radius: '20px',
  51.       },
  52.       margin: {
  53.         vertical: '12px',
  54.       },
  55.     },
  56.     spacing: '14px',
  57.     font: {
  58.       family: 'GT-Walsheim',
  59.       size: '14px',
  60.       weight: 400,
  61.       height: '17px',
  62.     },
  63.   },
  64.   header: {
  65.     height: '68px',
  66.   },
  67.   textArea: {
  68.     extend: () => `
  69.       resize: none;
  70.     `,
  71.   },
  72.   button: {
  73.     color: { light: '#9b9b9b', dark: 'white' },
  74.     border: {
  75.       width: '1px',
  76.       radius: '80px',
  77.       color: colors['light-6'],
  78.     },
  79.     primary: {
  80.       color: colors.brand,
  81.     },
  82.     extend: (props: AnyProps): string => `
  83.       ${props.plain ? '' : `padding: 8px ${props.primary ? '28px' : '12px'};`}
  84.       text-transform: ${props.primary ? 'uppercase' : 'none'};
  85.       line-height: ${props.primary ? '0px' : 'inherit'};
  86.       min-height: 40px;
  87.  
  88.       // Hack to style the Select's Button.
  89.       ${
  90.         props.id && props.id.indexOf('select') !== -1
  91.           ? `
  92.         max-width: none;
  93.         padding: 0;
  94.         width: 100%;
  95.       `
  96.           : ''
  97.       }
  98.     `,
  99.   },
  100.   text: {
  101.     medium: {
  102.       size: '16px',
  103.       height: '19px',
  104.     },
  105.   },
  106.   paragraph: {
  107.     medium: {
  108.       maxWidth: undefined,
  109.     },
  110.     xsmall: {
  111.       size: '12px',
  112.       height: '1.33',
  113.     },
  114.   },
  115.   textInput: {
  116.     extend: (props: AnyProps): string =>
  117.       `
  118.         height: 40px;
  119.         padding-left: 12px;
  120.         font-size: 14px;
  121.         font-weight: 400;
  122.         ${
  123.           props.noBorderRight || props.noBorder
  124.             ? `
  125.           border-bottom-right-radius: 0;
  126.           border-top-right-radius: 0;
  127.         `
  128.             : ''
  129.         }
  130.         ${
  131.           props.noBorderLeft || props.noBorder
  132.             ? `
  133.           border-bottom-left-radius: 0;
  134.           border-top-left-radius: 0;
  135.           border-left-width: 0;
  136.         `
  137.             : ''
  138.         }
  139.         ${
  140.           props.noBorderBottom
  141.             ? `
  142.           border-bottom-left-radius: 0;
  143.           border-bottom-right-radius: 0;
  144.         `
  145.             : ''
  146.         }
  147.         ${
  148.           props.noBorderTop
  149.             ? `
  150.           border-top-width: 0;
  151.           border-top-left-radius: 0;
  152.           border-top-right-radius: 0;
  153.         `
  154.             : ''
  155.         }
  156.         background: ${props.error ? 'status-error' : 'white'};
  157.       `,
  158.   },
  159.   select: {
  160.     background: colors.boxDefaultBg,
  161.   },
  162.   heading: {
  163.     level: {
  164.       1: {
  165.         medium: {
  166.           size: '32px',
  167.           weight: 600,
  168.           color: colors.darkBrand,
  169.         },
  170.       },
  171.       2: {
  172.         medium: {
  173.           size: '32px',
  174.           weight: 400,
  175.         },
  176.       },
  177.       4: {
  178.         medium: {
  179.           color: '#000000',
  180.           size: '13px',
  181.           margin: {
  182.             vertical: 0,
  183.           },
  184.         },
  185.       },
  186.     },
  187.   },
  188.   image: {
  189.     extend: (props: AnyProps): string => (props.round ? 'border-radius: 500px;' : ''),
  190.   },
  191.   dataTable: {
  192.     header: {
  193.       border: null,
  194.       pad: 'none',
  195.     },
  196.     body: {
  197.       pad: {
  198.         vertical: 'none',
  199.         horizontal: 'none',
  200.       },
  201.     },
  202.   },
  203.   table: {
  204.     header: {
  205.       extend: (): string => `
  206.         background: ${colors.tableHeaderBg};
  207.         &:first-of-type > div {
  208.           padding-left: 12px;
  209.         }
  210.       `,
  211.     },
  212.     body: {
  213.       extend: (): string => `
  214.         &:first-of-type {
  215.           padding: 0 12px;
  216.         }
  217.       `,
  218.     },
  219.   },
  220.   checkBox: {
  221.     hover: { border: { color: 'brand' } },
  222.   },
  223. }
  224.  
  225. export default theme
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement