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.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. brushFill: 'rgba(0,0,0,.1)',
  9. brushStroke: 'rgba(0,0,0,.5)',
  10. hint: 'rgba(66, 133, 244, 0.200)',
  11. selected: 'rgba(66, 133, 244, 1.000)',
  12. bounds: 'rgba(65, 132, 244, 1.000)',
  13. boundsBg: 'rgba(65, 132, 244, 0.100)',
  14. border: '#aaa',
  15. panel: '#fefefe',
  16. inactive: '#cccccf',
  17. hover: '#efefef',
  18. text: '#333',
  19. input: '#f3f3f3',
  20. inputBorder: '#ddd',
  21. },
  22. space: {},
  23. fontSizes: {
  24. 0: '10px',
  25. 1: '12px',
  26. 2: '13px',
  27. 3: '16px',
  28. 4: '18px',
  29. },
  30. fonts: {
  31. ui: '"Recursive", system-ui, sans-serif',
  32. },
  33. fontWeights: {},
  34. lineHeights: {},
  35. letterSpacings: {},
  36. sizes: {},
  37. borderWidths: {},
  38. borderStyles: {},
  39. radii: {},
  40. shadows: {},
  41. zIndices: {},
  42. transitions: {},
  43. },
  44. utils: {
  45. zStrokeWidth: () => (value: number | number[]) => {
  46. if (Array.isArray(value)) {
  47. return {
  48. strokeWidth: `calc(${value[0]}px / var(--camera-zoom))`,
  49. }
  50. }
  51. // const [val, min, max] = value
  52. // return {
  53. // strokeWidth:
  54. // min !== undefined && max !== undefined
  55. // ? `clamp(${min}, ${val} / var(--camera-zoom), ${max})`
  56. // : min !== undefined
  57. // ? `min(${min}, ${val} / var(--camera-zoom))`
  58. // : `calc(${val} / var(--camera-zoom))`,
  59. // }
  60. // }
  61. return {
  62. strokeWidth: `calc(${value}px / var(--camera-zoom))`,
  63. }
  64. },
  65. },
  66. })
  67. const light = theme({})
  68. const dark = theme({})
  69. const globalStyles = global({
  70. '*': { boxSizing: 'border-box' },
  71. ':root': {
  72. '--camera-zoom': 1,
  73. '--scale': 'calc(1 / var(--camera-zoom))',
  74. },
  75. 'html, body': {
  76. padding: '0px',
  77. margin: '0px',
  78. overscrollBehavior: 'none',
  79. fontFamily: '$ui',
  80. fontSize: '$2',
  81. },
  82. })
  83. export default styled
  84. export { css, getCssString, globalStyles, light, dark }