Skip to content

.mdc files for defining Cursor rules specific to emailing template

License

Notifications You must be signed in to change notification settings

StephaneBour/emails-cursor-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

📧 HTML Email Cursor Rules

Cursor Rules for HTML email development — Best practices for cross-client compatibility, accessibility, and responsive design with graceful degradation.

License: MIT Cursor


🎯 About

This repository contains a Cursor rules file (.cursor/rules/emails.mdc) that provides comprehensive guidelines for HTML email development. These rules ensure emails render correctly across all modern email clients while gracefully degrading on older ones.

✨ Features Covered

Category Description
📄 Document Structure HTML5 DOCTYPE, lang attributes, Microsoft namespaces
🖥️ Outlook Support DPI scaling, conditional tables, VML
📱 Responsive Design Mobile-first, media queries, stackable columns
🌙 Dark Mode Color-scheme meta tags, CSS overrides
Accessibility ARIA roles, semantic HTML, alt text
🎨 Styles Inline styles, fallbacks, web fonts
🔘 Buttons Bulletproof structure compatible with all clients
🖼️ Images Complete attributes, responsive, background color fallback

📥 Installation

Option 1: Direct Download

  1. Download the emails.mdc file from the .cursor/rules/ folder
  2. Place it in your project: .cursor/rules/emails.mdc

Option 2: Clone the Repository

git clone https://github.com/StephaneBour/emails-cursor-rules.git
cp emails-cursor-rules/.cursor/rules/emails.mdc your-project/.cursor/rules/

Option 3: Git Submodule

git submodule add https://github.com/StephaneBour/emails-cursor-rules.git .cursor/email-rules

🚀 Usage

Once the .cursor/rules/emails.mdc file is in your project, Cursor will automatically use it as context when generating HTML code for emails.

Usage Example

Simply ask Cursor:

"Create a responsive email template with a header, a CTA button, and a footer"

Cursor will automatically follow the best practices defined in the rules:

  • HTML5 structure with all necessary meta tags
  • Outlook support via conditional comments
  • Inline styles with fallbacks
  • Bulletproof buttons
  • Dark mode support

📋 Main Rules

1. Complete Document Structure

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <meta name="color-scheme" content="light dark">
    <!-- ... other meta tags -->
  </head>
  <body>
    <div lang="en" role="article" aria-roledescription="email">
      <!-- Email content -->
    </div>
  </body>
</html>

2. Conditional Tables for Outlook

<!--[if mso]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td>
<![endif]-->
<div style="max-width: 600px; margin: 0 auto;">
  Content
</div>
<!--[if mso]>
</td></tr></table>
<![endif]-->

3. Bulletproof Buttons

<table role="presentation" cellspacing="0" cellpadding="0" border="0">
  <tr>
    <td style="border-radius: 4px; background: #222222;">
      <a href="#" style="background: #222222; padding: 13px 17px; color: #ffffff; display: block;">
        Click here
      </a>
    </td>
  </tr>
</table>

🔗 Useful Resources

🤝 Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a branch (git checkout -b feature/improvement)
  3. Commit your changes (git commit -am 'Add a new rule')
  4. Push to the branch (git push origin feature/improvement)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


Made with ❤️ for the email developer community

About

.mdc files for defining Cursor rules specific to emailing template

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published