Skip to content

feat(editor): add global style setter functions to EmailTheming#3122

Merged
gabrielmfern merged 3 commits intofeat/ai-oss-editorfrom
cursor/email-theming-global-styles-c577
Mar 26, 2026
Merged

feat(editor): add global style setter functions to EmailTheming#3122
gabrielmfern merged 3 commits intofeat/ai-oss-editorfrom
cursor/email-theming-global-styles-c577

Conversation

@gabrielmfern
Copy link
Copy Markdown
Member

@gabrielmfern gabrielmfern commented Mar 26, 2026

Summary

Adds three new exported functions to the EmailTheming module, allowing consumers of @react-email/editor/plugins to programmatically update global styles, theme, and CSS injection on the editor document.

New Functions

  • setGlobalStyles(editor, styles) — Sets the global panel styles on the editor document (persists under the GlobalContent node's 'styles' key).
  • setCurrentTheme(editor, theme) — Sets the current email theme ('basic' or 'minimal') on the editor document (persists under the 'theme' key).
  • setGlobalCssInjected(editor, css) — Sets the global CSS string that gets injected into the email <head> (persists under the 'css' key).

All three functions use the existing editor.commands.setGlobalContent() command under the hood and are fully typed.

Exports

The functions are exported from @react-email/editor/plugins through the existing barrel re-export chain:
extension.tsxemail-theming/index.tsplugins/index.ts@react-email/editor/plugins

Version Bump

Bumps @react-email/editor from 0.0.0-experimental.340.0.0-experimental.35 for publishing after merge.

Slack Thread

Open in Web Open in Cursor 

Summary by cubic

Expose three helpers in EmailTheming to set global styles, the current theme, and injected CSS on the editor document from @react-email/editor/plugins. All functions call editor.commands.setGlobalContent; signatures were tidied.

  • New Features

    • setGlobalStyles(editor, styles) — set global panel styles.
    • setCurrentTheme(editor, theme) — set the current email theme.
    • setGlobalCssInjected(editor, css) — set CSS injected into the email head.
  • Dependencies

    • Bump @react-email/editor to 0.0.0-experimental.35.

Written for commit b069e5f. Summary will update on new commits.

…ted functions to EmailTheming

- setGlobalStyles: sets the global panel styles on the editor document
- setCurrentTheme: sets the current email theme on the editor document
- setGlobalCSSInjected: sets the global CSS string injected into the email <head>

All three functions are exported from @react-email/editor/plugins for consumer use.
Bumps version from 0.0.0-experimental.34 to 0.0.0-experimental.35.

Co-authored-by: Gabriel Miranda <gabrielmfern@outlook.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2026

⚠️ No Changeset found

Latest commit: 88a3ba7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-email Ready Ready Preview, Comment Mar 26, 2026 3:54pm
react-email-demo Ready Ready Preview, Comment Mar 26, 2026 3:54pm

Request Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@react-email/editor@3122

commit: 22ebe51

Co-authored-by: Gabriel Miranda <gabrielmfern@outlook.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Confidence score: 4/5

  • This PR looks safe to merge; the only noted issue is a naming-convention mismatch for an initialism in packages/editor/src/plugins/email-theming/extension.tsx.
  • Impact is low and mostly stylistic, but aligning the function name (e.g., camel-cased acronym) will improve consistency and readability.
  • Pay close attention to packages/editor/src/plugins/email-theming/extension.tsx - rename the initialism in the function to match convention.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/editor/src/plugins/email-theming/extension.tsx">

<violation number="1" location="packages/editor/src/plugins/email-theming/extension.tsx:215">
P2: Custom agent: **Initialisms and Acronyms Naming Conventions**

Rename the function to use camel-cased acronym (e.g., setGlobalCssInjected) to comply with the naming convention for initialisms.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Use camel-cased acronym per naming conventions.

Co-authored-by: Gabriel Miranda <gabrielmfern@outlook.com>
@gabrielmfern gabrielmfern merged commit e6bb467 into feat/ai-oss-editor Mar 26, 2026
15 of 16 checks passed
@gabrielmfern gabrielmfern deleted the cursor/email-theming-global-styles-c577 branch March 26, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants