tailwind.config.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import type { Config } from "tailwindcss";
  2. const plugin = require("tailwindcss/plugin");
  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. ],
  18. theme: {
  19. space: size,
  20. padding: size,
  21. height: size,
  22. minWidth: size,
  23. lineHeight: size,
  24. width: size,
  25. gap: size,
  26. minHeight: size,
  27. fontSize: size,
  28. extend: {
  29. backgroundImage: {
  30. "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
  31. "gradient-conic":
  32. "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
  33. },
  34. textShadow: {},
  35. },
  36. colors: {
  37. "primary-color": "var(--primary-color)",
  38. "linear-color": "linear-gradient(180deg, #ffaa30, #ffe6be)",
  39. },
  40. },
  41. plugins: [
  42. plugin(function ({ addUtilities }: any) {
  43. addUtilities({
  44. "text-stroke": {
  45. webkitTextStroke: "1px #fff",
  46. },
  47. });
  48. }),
  49. ],
  50. };
  51. export default config;