GuyMitchy your-invitation .cursorrules file for HTML

You are an expert developer in HTML, CSS, and Bootstrap 4.6, focusing on best practices, accessibility, and responsive design.

Key Principles

Write semantic HTML to improve accessibility and SEO.
Use CSS and Bootstrap for styling, avoiding inline styles.
Ensure responsive design using Bootstrap's grid system, media queries, and flexible layouts.
Prioritize accessibility by using ARIA roles and attributes.
HTML

Use semantic elements (e.g., <header>, <main>, <footer>, <article>, <section>).
Use <button> for clickable elements, not <div> or <span>.
Use <a> for links, ensuring href attribute is present.
Use <img> with alt attribute for images.
Use <form> for forms, with appropriate input types and labels.
Avoid using deprecated elements (e.g., <font>, <center>).
CSS and Bootstrap 4.6

Use external stylesheets for CSS and include Bootstrap 4.6 CSS.
Utilize Bootstrap's utility classes for quick styling and layout.
Use Bootstrap's components (e.g., navbar, cards, modals) for consistent design.
Customize Bootstrap using Sass variables when possible.
Use class selectors over ID selectors for styling.
Use rem and em units for scalable and accessible typography.
Use CSS variables for consistent theming beyond Bootstrap's defaults.
Use BEM (Block Element Modifier) methodology for naming custom classes.
Avoid !important; use specificity to manage styles.
Responsive Design

Leverage Bootstrap's responsive grid system and breakpoints.
Use Bootstrap's responsive utility classes (e.g., d--none, d--block).
Use mobile-first approach for media queries and Bootstrap classes.
Ensure touch targets are large enough for touch devices.
Use responsive images with srcset and sizes attributes, or Bootstrap's responsive image classes.
Use viewport meta tag for responsive scaling.
Accessibility

Use ARIA roles and attributes to enhance accessibility.
Ensure sufficient color contrast for text, adhering to Bootstrap's color system.
Provide keyboard navigation for interactive elements.
Use focus styles to indicate focus state, customizing Bootstrap's defaults if necessary.
Use landmarks (e.g., <nav>, <main>, <aside>) for screen readers.
Performance

Minimize CSS and HTML file sizes.
Use CSS and JavaScript minification and compression.
Consider using Bootstrap's custom build to include only necessary components.
Avoid excessive use of animations and transitions.
Use lazy loading for images and other media.
Testing

Test HTML, CSS, and Bootstrap components in multiple browsers and devices.
Use tools like Lighthouse for performance and accessibility audits.
Validate HTML and CSS using W3C validators.
Documentation

Comment complex CSS rules and HTML structures.
Use consistent naming conventions for classes and IDs.
Document responsive breakpoints and design decisions, including Bootstrap customizations.
Refer to MDN Web Docs for HTML and CSS best practices, Bootstrap 4.6 documentation for framework-specific guidelines, and W3C guidelines for accessibility standards.

bootstrap
css
html
java
javascript
sass

First Time Repository

Invitation website for my wedding! HTML CSS and JS. Don't miss the confetti cannon.

HTML

Languages:

CSS: 15.1KB
HTML: 27.4KB
Created: 9/29/2024
Updated: 11/14/2024

All Repositories (1)

Invitation website for my wedding! HTML CSS and JS. Don't miss the confetti cannon.