tailwind.config.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 keyframes = {
  8. "slow-bounce": {
  9. "0%,100%": {
  10. transform: "translateY(-10px)",
  11. animationTimingFunction: "cubic-bezier(0.8, 0, 1, 1)",
  12. },
  13. "50%": {
  14. transform: "none",
  15. animationTimingFunction: "cubic-bezier(0, 0, 0.2, 1)",
  16. },
  17. },
  18. };
  19. const size: any = Array.from({ length: 100 }).reduce((map: any, _, index) => {
  20. map[index] = toRem(index);
  21. return map;
  22. }, {});
  23. // 0.0694rem
  24. const config: Config = {
  25. content: [
  26. "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
  27. "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
  28. "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
  29. ],
  30. theme: {
  31. space: size,
  32. padding: size,
  33. height: size,
  34. minWidth: size,
  35. lineHeight: size,
  36. width: size,
  37. gap: size,
  38. minHeight: size,
  39. fontSize: size,
  40. extend: {
  41. backgroundImage: {
  42. "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
  43. "gradient-conic":
  44. "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
  45. },
  46. textShadow: {},
  47. keyframes: keyframes,
  48. animation: {
  49. "slow-bounce": "slow-bounce 1s linear infinite",
  50. },
  51. },
  52. colors: {
  53. "primary-color": "var(--primary-color)",
  54. "linear-color": "linear-gradient(180deg, #ffaa30, #ffe6be)",
  55. },
  56. },
  57. plugins: [
  58. plugin(function ({ addUtilities }: any) {
  59. addUtilities({
  60. "text-stroke": {
  61. webkitTextStroke: "1px #fff",
  62. },
  63. });
  64. }),
  65. ],
  66. };
  67. export default config;