tailwind.config.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import type { Config } from 'tailwindcss';
  2. import type { DefaultColors } from 'tailwindcss/types/generated/colors';
  3. const themeDark = (colors: DefaultColors) => ({
  4. 50: '#0a0a0a',
  5. 100: '#111111',
  6. 200: '#1c1c1c',
  7. });
  8. const themeLight = (colors: DefaultColors) => ({
  9. 50: '#fcfcf9',
  10. 100: '#f3f3ee',
  11. 200: '#e8e8e3',
  12. });
  13. const config: Config = {
  14. content: [
  15. './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
  16. './src/components/**/*.{js,ts,jsx,tsx,mdx}',
  17. './src/app/**/*.{js,ts,jsx,tsx,mdx}',
  18. ],
  19. darkMode: 'class',
  20. theme: {
  21. extend: {
  22. borderColor: ({ colors }) => {
  23. return {
  24. light: themeLight(colors),
  25. dark: themeDark(colors),
  26. };
  27. },
  28. colors: ({ colors }) => {
  29. const colorsDark = themeDark(colors);
  30. const colorsLight = themeLight(colors);
  31. return {
  32. dark: {
  33. primary: colorsDark[50],
  34. secondary: colorsDark[100],
  35. ...colorsDark,
  36. },
  37. light: {
  38. primary: colorsLight[50],
  39. secondary: colorsLight[100],
  40. ...colorsLight,
  41. },
  42. };
  43. },
  44. },
  45. },
  46. plugins: [require('@tailwindcss/typography')],
  47. };
  48. export default config;