Skip to content

fix(email-editor): ship the editor's own stylesheet for Tailwind apps - #194

Merged
s3rot0n1n merged 1 commit into
mainfrom
fix/email-editor-scoped-stylesheet
Nov 12, 2026
Merged

s3rot0n1n merged 1 commit into
mainfrom
fix/email-editor-scoped-stylesheet

Conversation

@clbotdev

Copy link
Copy Markdown
Contributor

Problem

Since 0.3.0, @sendlit/email-editor gets almost all of its look from a plain stylesheet, src/editor.css (about 2,000 lines of .sle-* rules). Apps that already use Tailwind can't get those rules the way the README describes:

  • A Tailwind @source scan only builds utility classes. It can't produce plain CSS, so with just @source the editor renders unstyled.
  • The only exported stylesheet, styles.css, bundles editor.css with a full Tailwind 3 build. That build includes Tailwind's base reset, its utility classes and :root theme variables (--background, --primary, --border, …). Loading it in a Tailwind app overrides that app's own theme and resets everywhere, not just in the editor.

Found while upgrading CourseLit's admin, which uses Tailwind 4, to email-blocks 0.5.1 and email-editor 0.3.0. The editor showed up unstyled.

Fix

  • The build copies src/editor.css to dist/editor.css (a tsup onSuccess step).
  • It is exported as @sendlit/email-editor/editor.css. Its rules are scoped to the editor (.sle, with its own --sle-* variables), so it's safe to load next to the host app's styles.
  • The README now says which stylesheet to use: styles.css for apps without Tailwind; @source plus editor.css for apps with it.
  • A patch changeset for @sendlit/email-editor is included.

Checks

  • email-editor: typecheck, build and tests (99/99) pass. dist/editor.css is byte-identical to src/editor.css.
  • Checked end to end in CourseLit's admin: with this file added to the installed 0.3.0 package and import "@sendlit/email-editor/editor.css" in the admin layout, the editor renders fully styled (Write/Style switch, checklist, block handles, canvas). The rest of the admin's styling is unchanged.

Since 0.3.0 the editor is styled by plain CSS (editor.css) that a
Tailwind @source scan can't produce, and styles.css also carries a full
Tailwind build, base reset and :root theme variables that restyle the
host app. Copy editor.css into dist and export it as
@sendlit/email-editor/editor.css, and say in the README which to load.
@s3rot0n1n
s3rot0n1n merged commit 71c877d into main Nov 12, 2026
6 checks passed
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.

2 participants