|
| 1 | +--- |
| 2 | +description: Best practices for Tailwind CSS |
| 3 | +globs: *.vue |
| 4 | +alwaysApply: false |
| 5 | +--- |
| 6 | +- Implement responsive design with Tailwind's responsive modifiers |
| 7 | +- All colors and themes should be consistent with the overall UI element-plus. Please refer to `src/theme/element.scss` |
| 8 | +- Customize Tailwind's default theme using `tailwind.config.js` |
| 9 | +- Use `@apply` directive for component-level styling |
| 10 | + |
| 11 | +## Dark Mode Guidelines |
| 12 | +- **Color Variables**: Use CSS custom properties defined in `src/theme/dark.scss` for dark mode colors |
| 13 | +- **Primary Colors**: |
| 14 | + - Background: `--next-bg-main` (#17202a) - Twitter standard dark background |
| 15 | + - Text: `--next-color-white` (#f7f9f9) - Primary text color |
| 16 | + - Accent: `#1d9bf0` - Twitter blue for active states and links |
| 17 | +- **Component Colors**: |
| 18 | + - Disabled background: `--next-color-disabled` (#202e3a) |
| 19 | + - Hover states: `--next-color-hover` (#1e2732) or `--next-color-hover-rgba` (rgba(239, 243, 244, 0.1)) |
| 20 | + - Borders: `--next-border-color` (#38444d) or `--next-border-black` (#2f3336) |
| 21 | +- **Text Colors**: |
| 22 | + - Regular text: `--next-text-color-regular` (#8b98a5) |
| 23 | + - Placeholder text: `--next-text-color-placeholder` (#536471) |
| 24 | +- **Consistency Rules**: |
| 25 | + - Always use `[data-theme='dark']` selector for dark mode styles |
| 26 | + - Maintain Twitter-inspired color scheme consistency |
| 27 | + - Use semi-transparent overlays for hover effects: `rgba(29, 155, 240, 0.1)` for primary, `rgba(239, 243, 244, 0.1)` for neutral |
| 28 | +- **Component Specific**: |
| 29 | + - Cards: Background `--next-color-disabled` with `--next-border-color` borders |
| 30 | + - Buttons: Use defined CSS variables, avoid hardcoded colors |
| 31 | + - Forms: Input background `#273340`, border `#38444d`, focus with Twitter blue accent |
| 32 | + - Tables: Header background `#1c2732`, hover `--next-color-hover` |
| 33 | +- **Avoid**: Hardcoded hex colors in dark mode, use CSS variables for maintainability |
0 commit comments