|
51 | 51 | } |
52 | 52 | } |
53 | 53 |
|
| 54 | +@layer components { |
| 55 | + /* |
| 56 | + * Button component classes shared between the React `Button` component |
| 57 | + * (assets/js/dashboard/components/button.tsx) and the Phoenix `button` |
| 58 | + * component (lib/plausible_web/components/generic.ex). Update here only. |
| 59 | + */ |
| 60 | + .btn-base { |
| 61 | + @apply whitespace-nowrap truncate inline-flex items-center justify-center |
| 62 | + gap-x-2 text-sm font-medium rounded-md cursor-pointer |
| 63 | + disabled:cursor-not-allowed; |
| 64 | + } |
| 65 | + |
| 66 | + .btn-sm { |
| 67 | + @apply px-3 py-2; |
| 68 | + } |
| 69 | + |
| 70 | + .btn-md { |
| 71 | + @apply px-3.5 py-2.5; |
| 72 | + } |
| 73 | + |
| 74 | + .btn-theme-primary { |
| 75 | + @apply border border-indigo-600 bg-indigo-600 text-white |
| 76 | + hover:bg-indigo-700 focus-visible:outline-indigo-600 |
| 77 | + disabled:border-transparent disabled:bg-indigo-400/60 |
| 78 | + disabled:dark:bg-indigo-600/30 disabled:dark:text-white/35; |
| 79 | + } |
| 80 | + |
| 81 | + .btn-theme-secondary { |
| 82 | + @apply border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-700 |
| 83 | + text-gray-800 dark:text-gray-100 hover:bg-gray-50 hover:text-gray-900 |
| 84 | + dark:hover:bg-gray-600 dark:hover:border-gray-600 dark:hover:text-white |
| 85 | + disabled:text-gray-700/40 dark:disabled:text-gray-500 |
| 86 | + dark:disabled:bg-gray-800 dark:disabled:border-gray-800; |
| 87 | + } |
| 88 | + |
| 89 | + .btn-theme-yellow { |
| 90 | + @apply border border-yellow-600/90 bg-yellow-600/90 text-white |
| 91 | + hover:bg-yellow-600 focus-visible:outline-yellow-600 |
| 92 | + disabled:border-yellow-400/60 disabled:bg-yellow-400/60 |
| 93 | + disabled:dark:border-yellow-600/30 disabled:dark:bg-yellow-600/30 |
| 94 | + disabled:dark:text-white/35; |
| 95 | + } |
| 96 | + |
| 97 | + .btn-theme-danger { |
| 98 | + @apply border border-gray-300 dark:border-gray-800 text-red-600 bg-white |
| 99 | + dark:bg-gray-800 hover:text-red-700 dark:hover:text-red-400 |
| 100 | + dark:text-red-500 active:text-red-800 disabled:text-red-700/40 |
| 101 | + disabled:hover:shadow-none dark:disabled:text-red-500/35 |
| 102 | + dark:disabled:bg-gray-800; |
| 103 | + } |
| 104 | + |
| 105 | + .btn-theme-ghost { |
| 106 | + @apply border border-transparent text-gray-700 dark:text-gray-300 |
| 107 | + hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100 |
| 108 | + dark:hover:bg-gray-800 hover:border-gray-100 dark:hover:border-gray-800 |
| 109 | + disabled:text-gray-500 disabled:dark:text-gray-600 |
| 110 | + disabled:hover:bg-transparent disabled:hover:border-transparent; |
| 111 | + } |
| 112 | + |
| 113 | + .btn-theme-icon { |
| 114 | + @apply border border-transparent text-gray-400 dark:text-gray-400 |
| 115 | + hover:text-gray-900 dark:hover:text-gray-100; |
| 116 | + } |
| 117 | +} |
| 118 | + |
54 | 119 | @theme { |
55 | 120 | /* Color aliases from tailwind.config.js */ |
56 | 121 |
|
|
0 commit comments