tailwind.config.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. const { blackA, mauve, violet } = require('@radix-ui/colors');
  2. /** @type {import('tailwindcss').Config} */
  3. export default {
  4. content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
  5. future: {
  6. hoverOnlyWhenSupported: true,
  7. },
  8. theme: {
  9. extend: {
  10. maxHeight: {
  11. '20vh': '20vh',
  12. '70vh': '70vh',
  13. // 添加其他需要的值
  14. },
  15. backgroundImage: {
  16. 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
  17. 'gradient-conic':
  18. 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
  19. },
  20. backgroundColor: {
  21. 'blue-500': 'rgb(68, 145, 249)',
  22. },
  23. colors: {
  24. ...blackA,
  25. ...mauve,
  26. ...violet,
  27. 'media-brand': 'rgb(var(--media-brand) / <alpha-value>)',
  28. 'media-focus': 'rgb(var(--media-focus) / <alpha-value>)',
  29. },
  30. keyframes: {
  31. slideUpAndFade: {
  32. from: { opacity: 0, transform: 'translateY(2px)' },
  33. to: { opacity: 1, transform: 'translateY(0)' },
  34. },
  35. slideRightAndFade: {
  36. from: { opacity: 0, transform: 'translateX(-2px)' },
  37. to: { opacity: 1, transform: 'translateX(0)' },
  38. },
  39. slideDownAndFade: {
  40. from: { opacity: 0, transform: 'translateY(-2px)' },
  41. to: { opacity: 1, transform: 'translateY(0)' },
  42. },
  43. slideLeftAndFade: {
  44. from: { opacity: 0, transform: 'translateX(2px)' },
  45. to: { opacity: 1, transform: 'translateX(0)' },
  46. },
  47. hide: {
  48. from: { opacity: 1 },
  49. to: { opacity: 0 },
  50. },
  51. slideIn: {
  52. from: {
  53. transform: 'translateX(calc(100% + var(--viewport-padding)))',
  54. },
  55. to: { transform: 'translateX(0)' },
  56. },
  57. swipeOut: {
  58. from: { transform: 'translateX(var(--radix-toast-swipe-end-x))' },
  59. to: { transform: 'translateX(calc(100% + var(--viewport-padding)))' },
  60. },
  61. },
  62. animation: {
  63. hide: 'hide 100ms ease-in',
  64. slideIn: 'slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1)',
  65. swipeOut: 'swipeOut 100ms ease-out',
  66. slideUpAndFade: 'slideUpAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)',
  67. slideRightAndFade:
  68. 'slideRightAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)',
  69. slideDownAndFade:
  70. 'slideDownAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)',
  71. slideLeftAndFade:
  72. 'slideLeftAndFade 400ms cubic-bezier(0.16, 1, 0.3, 1)',
  73. },
  74. },
  75. },
  76. plugins: [
  77. require('tailwindcss-animate'),
  78. // require('@vidstack/react/tailwind.cjs')({
  79. // prefix: 'media',
  80. // }),
  81. customVariants,
  82. ],
  83. };
  84. function customVariants({ addVariant, matchVariant }) {
  85. // Strict version of `.group` to help with nesting.
  86. matchVariant('parent-data', (value) => `.parent[data-${value}] > &`);
  87. addVariant('hocus', ['&:hover', '&:focus-visible']);
  88. addVariant('group-hocus', ['.group:hover &', '.group:focus-visible &']);
  89. }