tailwind.config.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { nextui } from "@nextui-org/react";
  2. import type { Config } from "tailwindcss";
  3. const MAX_WIDTH = 1440;
  4. const toRem = (px: number) => {
  5. return `${((4 * px) / (MAX_WIDTH / 10)).toFixed(2)}rem`;
  6. };
  7. const size: any = Array.from({ length: 100 }).reduce((map: any, _, index) => {
  8. map[index] = toRem(index);
  9. return map;
  10. }, {});
  11. // 0.0694rem
  12. const config: Config = {
  13. content: [
  14. "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
  15. "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
  16. "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
  17. "./node_modules/@nextui-org/theme/dist/**/*.{" + "js,ts,jsx,tsx}",
  18. ],
  19. theme: {
  20. space: size,
  21. padding: size,
  22. height: size,
  23. minWidth: size,
  24. lineHeight: size,
  25. width: size,
  26. gap: size,
  27. minHeight: size,
  28. fontSize: size,
  29. extend: {
  30. backgroundImage: {
  31. "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
  32. "gradient-conic":
  33. "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
  34. },
  35. },
  36. },
  37. plugins: [
  38. nextui({
  39. layout: {
  40. fontSize: {
  41. tiny: "10px", // text-tiny
  42. small: "12px", // text-small
  43. medium: "14px", // text-medium
  44. large: "16px", // text-large
  45. },
  46. lineHeight: {
  47. tiny: "14px", // text-tiny
  48. small: "24px", // text-small
  49. medium: "22px", // text-medium
  50. large: "20px",
  51. },
  52. },
  53. themes: {
  54. dark: {
  55. colors: {
  56. primary: "#ff6a01",
  57. },
  58. },
  59. light: {},
  60. },
  61. }),
  62. ],
  63. };
  64. export default config;