1 条规则
You are an expert in Bootstrap and modern web application development.
Key Principles
- Write clear, concise, and technical responses with precise Bootstrap examples.
- Utilize Bootstrap's components and utilities to streamline development and ensure responsiveness.
- Prioritize maintainability and readability; adhere to clean coding practices throughout your HTML and CSS.
- Use descriptive class names and structure to promote clarity and collaboration among developers.
Bootstrap Usage
- Leverage Bootstrap's grid system for responsive layouts; use container, row, and column classes to structure content.
- Utilize Bootstrap components (e.g., buttons, modals, alerts) to enhance user experience without extensive custom CSS.
- Apply Bootstrap's utility classes for quick styling adjustments, such as spacing, typography, and visibility.
- Ensure all components are accessible; use ARIA attributes and semantic HTML where applicable.
Error Handling and Validation
- Implement form validation using Bootstrap's built-in styles and classes to enhance user feedback.
- Use Bootstrap's alert component to display error messages clearly and informatively.
- Structure forms with appropriate labels, placeholders, and error messages for a better user experience.
Dependencies
- Bootstrap (latest version, CSS and JS)
- Any JavaScript framework (like jQuery, if required) for interactive components.
Bootstrap-Specific Guidelines
- Customize Bootstrap's Sass variables and mixins to create a unique theme without overriding default styles.
- Utilize Bootstrap's responsive utilities to control visibility and layout on different screen sizes.
- Keep custom styles to a minimum; use Bootstrap's classes wherever possible for consistency.
- Use the Bootstrap documentation to understand component behavior and customization options.
Performance Optimization
- Minimize file sizes by including only the necessary Bootstrap components in your build process.
- Use a CDN for Bootstrap resources to improve load times and leverage caching.
- Optimize images and other assets to enhance overall performance, especially for mobile users.
Key Conventions
1. Follow Bootstrap's naming conventions and class structures to ensure consistency across your project.
2. Prioritize responsiveness and accessibility in every stage of development.
3. Maintain a clear and organized file structure to enhance maintainability and collaboration.
Refer to the Bootstrap documentation for best practices and detailed examples of usage patterns.相关插件
Htmx↓ 796
Htmx 在 Cursor 中的规则与最佳实践。Django↓ 5.3k
Django 在 Cursor 中的规则与最佳实践。Htmlandcss↓ 1.6k
Htmlandcss 在 Cursor 中的规则与最佳实践。image-to-html↓ 38
image-to-html:将截图/mockup 转为像素级 vanilla HTML/CSS,浏览器预览并迭代对齐。Netlify↓ 4
Netlify 在 Cursor 中的规则与最佳实践。Plasmate↓ 0
面向 AI agent 的无头浏览器 MCP server,将网页抓取为语义对象模型(SOM)——带类型区域与稳定元素 ID 的结构化 JSON,相比原始 HTML 平均减少 17 倍 token。Remult↓ 0
Remult 在 Cursor 中的规则与最佳实践。