Theme.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. Copyright (C) 2021 Cloudbase Solutions SRL
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. import { css } from 'styled-components'
  15. const exactWidth = (width: string) => css`
  16. min-width: ${width};
  17. max-width: ${width};
  18. `
  19. const exactHeight = (height: string) => css`
  20. min-height: ${height};
  21. max-height: ${height};
  22. `
  23. export const ThemePalette = {
  24. primary: '#0044CB',
  25. primaryLight: '#000EA9',
  26. secondary: '#D9DCE3',
  27. secondaryLight: '#777A8B',
  28. black: '#202134',
  29. alert: '#F91661',
  30. success: '#4CD964',
  31. warning: '#FDC02F',
  32. grayscale: [
  33. '#D8DBE2', // 0
  34. '#ECEDF1', // 1
  35. '#C8CCD7', // 2
  36. '#A4AAB5', // 3
  37. '#616770', // 4
  38. '#7F8795', // 5
  39. '#1B2733', // 6
  40. '#F2F3F4', // 7
  41. '#858B93', // 8
  42. ],
  43. }
  44. export const ThemeProps = {
  45. fontWeights: {
  46. extraLight: 200,
  47. light: 300,
  48. regular: 400,
  49. medium: 500,
  50. bold: 600,
  51. },
  52. inputSizes: {
  53. regular: { width: 208, height: 32 },
  54. large: { width: 224, height: 32 },
  55. wizard: { width: 384 },
  56. },
  57. borderRadius: '4px',
  58. contentWidth: '928px',
  59. boxShadow: 'box-shadow: rgba(0, 0, 0, 0.1) 0 0 6px 2px;',
  60. animations: {
  61. swift: '.45s cubic-bezier(0.3, 1, 0.4, 1) 0s',
  62. rotation: css`
  63. animation: rotate 2s infinite linear;
  64. @keyframes rotate {
  65. from {transform: rotate(0deg);}
  66. to {transform: rotate(360deg);}
  67. }
  68. `,
  69. disabledLoading: css`
  70. animation: opacityToggle 750ms linear infinite alternate-reverse;
  71. @keyframes opacityToggle {
  72. 0% {opacity: 1;}
  73. 100% {opacity: 0.3;}
  74. }
  75. `,
  76. },
  77. mobileMaxWidth: 1350,
  78. exactWidth,
  79. exactHeight,
  80. exactSize: (size: string) => css`
  81. ${exactWidth(size)}
  82. ${exactHeight(size)}
  83. `,
  84. }