Problem/Motivation

The Artisan starterkit's ckeditor.css used the same @source scanning directives as main.css, pointing at the theme's templates, components and source files. This caused Tailwind to emit the full set of utility classes into the CKEditor stylesheet — duplicating everything already in main.css.

Additionally, DaisyUI component styles were generated at root scope instead of being scoped to .ck-content, so they bled outside the editor context and could affect unrelated page elements.

Steps to reproduce

  1. Install the Artisan starterkit.
  2. Inspect the compiled ckeditor.css output.
  3. Observe that all Tailwind utility classes are present (mirroring main.css).
  4. Observe DaisyUI component styles applied at root scope, not scoped to .ck-content.

Proposed resolution

Drop all @source scanning from ckeditor.css and use source(none) on both Tailwind imports so no utility classes are emitted unless explicitly referenced. Import only the partials the editor actually needs, and scope everything that touches rendered content under .ck-content:

@import "tailwindcss/theme" source(none);
@import "tailwindcss/utilities" source(none);

@import "@src/_variables.css";
@import "@src/_tailwind_theme.css";
@import "@src/_buttons.css";

.ck-content {
  @import "@src/_base.css";
}

The result is a minimal stylesheet containing only CSS custom properties, the theme mapping, and base typography — all properly scoped to the editor.

Issue fork artisan-3588701

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

frouco created an issue. See original summary.

alejandro cabarcos’s picture

Assigned: frouco » manuelbermudez

manuelbermudez made their first commit to this issue’s fork.

alejandro cabarcos’s picture

Assigned: manuelbermudez » frouco
Status: Active » Needs review
frouco’s picture

Work as expected.

frouco’s picture

Assigned: frouco » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.