You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stitches.config.ts 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import { createCss, defaultThemeMap } from '@stitches/react'
  2. const { styled, global, css, theme, getCssString } = createCss({
  3. themeMap: {
  4. ...defaultThemeMap,
  5. },
  6. theme: {
  7. colors: {
  8. codeHl: 'rgba(144, 144, 144, .15)',
  9. brushFill: 'rgba(0,0,0,.05)',
  10. brushStroke: 'rgba(0,0,0,.25)',
  11. hint: 'rgba(216, 226, 249, 1.000)',
  12. selected: 'rgba(66, 133, 244, 1.000)',
  13. bounds: 'rgba(65, 132, 244, 1.000)',
  14. boundsBg: 'rgba(65, 132, 244, 0.05)',
  15. highlight: 'rgba(65, 132, 244, 0.15)',
  16. overlay: 'rgba(0, 0, 0, 0.15)',
  17. border: '#aaa',
  18. canvas: '#fafafa',
  19. panel: '#fefefe',
  20. inactive: '#cccccf',
  21. hover: '#efefef',
  22. text: '#333',
  23. muted: '#777',
  24. input: '#f3f3f3',
  25. inputBorder: '#ddd',
  26. lineError: 'rgba(255, 0, 0, .1)',
  27. },
  28. space: {},
  29. fontSizes: {
  30. 0: '10px',
  31. 1: '12px',
  32. 2: '13px',
  33. 3: '16px',
  34. 4: '18px',
  35. },
  36. fonts: {
  37. ui: '"Recursive", system-ui, sans-serif',
  38. body: '"Recursive", system-ui, sans-serif',
  39. mono: '"Recursive Mono", monospace',
  40. },
  41. fontWeights: {},
  42. lineHeights: {},
  43. letterSpacings: {},
  44. sizes: {},
  45. borderWidths: {},
  46. borderStyles: {},
  47. radii: {},
  48. shadows: {},
  49. zIndices: {},
  50. transitions: {},
  51. },
  52. media: {
  53. sm: '(min-width: 640px)',
  54. md: '(min-width: 768px)',
  55. },
  56. utils: {
  57. zDash: () => (value: number) => {
  58. return {
  59. strokeDasharray: `calc(${value}px / var(--camera-zoom)) calc(${value}px / var(--camera-zoom))`,
  60. }
  61. },
  62. zStrokeWidth: () => (value: number | number[]) => {
  63. if (Array.isArray(value)) {
  64. return {
  65. strokeWidth: `calc(${value[0]}px / var(--camera-zoom))`,
  66. }
  67. }
  68. return {
  69. strokeWidth: `calc(${value}px / var(--camera-zoom))`,
  70. }
  71. },
  72. },
  73. })
  74. const light = theme({})
  75. const dark = theme({})
  76. const globalStyles = global({
  77. '*': { boxSizing: 'border-box' },
  78. ':root': {
  79. '--camera-zoom': 1,
  80. '--scale': 'calc(1 / var(--camera-zoom))',
  81. },
  82. 'html, body': {
  83. padding: '0px',
  84. margin: '0px',
  85. overscrollBehavior: 'none',
  86. fontFamily: '$ui',
  87. fontSize: '$2',
  88. backgroundColor: '$canvas',
  89. },
  90. })
  91. export default styled
  92. export { css, getCssString, globalStyles, light, dark }