tailwind.config.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import type { Config } from "tailwindcss";
  2. const MAX_WIDTH = 1440;
  3. const toRem = (px: number) => {
  4. return `${((4 * px) / (MAX_WIDTH / 10)).toFixed(2)}rem`;
  5. };
  6. const size: any = Array.from({ length: 100 }).reduce((map: any, _, index) => {
  7. map[index] = toRem(index);
  8. return map;
  9. }, {});
  10. // 0.0694rem
  11. const config: Config = {
  12. content: [
  13. "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
  14. "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
  15. "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
  16. ],
  17. theme: {
  18. space: size,
  19. padding: size,
  20. height: size,
  21. minWidth: size,
  22. lineHeight: size,
  23. width: size,
  24. gap: size,
  25. minHeight: size,
  26. fontSize: size,
  27. extend: {
  28. backgroundImage: {
  29. "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
  30. "gradient-conic":
  31. "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
  32. },
  33. },
  34. colors: {
  35. "primary-color": "#ff6a01",
  36. "linear-color": "linear-gradient(180deg, #ffaa30, #ffe6be)",
  37. },
  38. },
  39. plugins: [],
  40. };
  41. export default config;