Theme.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 {
  66. transform: rotate(0deg);
  67. }
  68. to {
  69. transform: rotate(360deg);
  70. }
  71. }
  72. `,
  73. disabledLoading: css`
  74. animation: opacityToggle 750ms linear infinite alternate-reverse;
  75. @keyframes opacityToggle {
  76. 0% {
  77. opacity: 1;
  78. }
  79. 100% {
  80. opacity: 0.3;
  81. }
  82. }
  83. `,
  84. },
  85. mobileMaxWidth: 1350,
  86. exactWidth,
  87. exactHeight,
  88. exactSize: (size: string) => css`
  89. ${exactWidth(size)}
  90. ${exactHeight(size)}
  91. `,
  92. };