Block editor not respecting block color setting
-
When using the latest Twenty twenty two theme(tested this on three different servers with default WordPress installs), setting the color for a code block does not work properly. Setting the background color that is right beside the color setting does work though.
It appears that the parent of the blocks generated
<code>
element is automatically a<pre>
element with css classes added to it depending on what color you choose for the block color and background color, like below:<code><pre class="wp-block-code has-vivid-red-color has-vivid-purple-background-color has-text-color has-background"><code><?php echo "Some code goes here"; ?></code></pre>
However the actual
<code>
element that is generated has its color overridden by an inline block of css that appears to be automatically added, from I have no idea what, like below:.wp-block-code > code { font-family: Menlo,Consolas,monaco,monospace; color: #1e1e1e; /* I can over ride this line in my style.css sheet, but why is this whole css block being generated that overrides my block setting for color? */ padding: .8em 1em; border: 1px solid #ddd; border-radius: 4px; }
Does anyone know if the above css block can be changed in the dashboard settings somewhere without having to override it with css, or is this a bug with the twenty twenty two theme, or maybe the block editor?
- The topic ‘Block editor not respecting block color setting’ is closed to new replies.