Make WordPress Core

Opened 5 weeks ago

Last modified 3 weeks ago

#66310 new defect (bug)

custom css applied in editor is not picked up by blocks after 7.1.3 update

Reported by: smithkr Owned by:
Priority: normal Milestone: Awaiting Review
Component: Editor Version: 7.1.3
Severity: normal Keywords:
Cc: Focuses:

Description

I haven't seen a ticket for this one; hope it's not a duplicate.

Any custom css or classes added in the Additional CSS Classes or the Additional CSS fields is ignored, even when the css is valid, isn't clashing with other rules, and is saved on the page or the customizer. This seems to be related to the 7.1.3 update; no other changes have been made and these fields worked as expected before the update.

Change History (3)

#1 @iamchitti
5 weeks ago

Hi @smithkr, thanks for the report.

I compared 7.1.2 and 7.1.3, and the release doesn't change the block editor, global styles, or custom CSS handling, so something else may be overriding your styles.

Block-level Additional CSS is output with low specificity (:root :where(.wp-custom-css-N)), so a more specific theme or plugin rule will win over it.

Could you share:

  1. Your active theme and plugins.
  2. A minimal example: the block, the CSS you added, and whether it fails in the editor, on the front end, or both.
  3. In DevTools, whether your rule is crossed out, and if so, which selector overrides it.

#2 @smithkr
5 weeks ago

Hi @iamchitti, to clarify:

*Any* css added fails in both the editor and the frontend, no matter what block it's added to, or what theme and/or plugins are used. The rules/classes aren't shown at all in DevTools, but if you add the class in DevTools for example, it shows as expected. So the class/rules added are saved in WordPress, but they don't show.

#3 @whiteshadow01
3 weeks ago

Could you mention the theme you are using and any third-party plugins you might be using? Can you mention the steps to reproduce the issue on a brand new WordPress site?

Last edited 3 weeks ago by whiteshadow01 (previous) (diff)
Note: See TracTickets for help on using tickets.