Customize Basic HTML Element

Created on 28 August 2024, about 1 month ago

Problem/Motivation

I just realized that it is impossible to customize default HTML elements with the Tutorial .

ckeditor5-stylesheets:
  - css/cke5-style.css
    

When I try to customize the blockquote border-left color, I cannot surpass inline JavaScript specificity CSS 1:0:0:0 without using !important.

Steps to Reproduce

  • PHP 8.1.18
  • Drupal 9.5.11
  • CKEditor 5 9.5.11 module

Create a new CSS file ckeditor5.css in sites and add the following:

blockquote {
    border-left: 3px solid red;
}
    

In your {site}.info.yml file, add:

ckeditor5-stylesheets:
  - ckeditor5.css
    

You will see in your frontend devtools that the inline CKEditor 5 style overrides your customization.

Proposed Resolution

We need a way to inject custom CSS that overrides any CKEditor 5 default inline style without using !important in the CSS file.

I don't know if it's possible to inject the custom CSS file into the CKEditor instance when it's created to inline it?

🐛 Bug report
Status

Closed: won't fix

Component

Code

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

  • Regression

    It restores functionality that was present in earlier versions.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024