I am having a strange issue with yarn. We have pushed to our staging area and ran yarn:build but the gutenberg editor is not looking correct. It is like it is missing some css styles.
When I run
yarn:build or yarn:production
I get this below
You can see in the first image that the toolbar styling is off, plus the font is being pulled in from the front end.
For some reason extra css is being injected into the bottom of the page.
What seems to be happening is tailwind is being complied with the .editor-styles-wrapper.
example:
/**
* Manually forked from SUIT CSS Base: https://github.com/suitcss/base
* A thin layer on top of normalize.css that provides a starting point more
* suitable for web applications.
*/
/**
* Removes the default spacing and border for appropriate elements.
*/
.editor-styles-wrapper blockquote,
.editor-styles-wrapper dl,
.editor-styles-wrapper dd,
.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4,
.editor-styles-wrapper h5,
.editor-styles-wrapper h6,
.editor-styles-wrapper hr,
.editor-styles-wrapper figure,
.editor-styles-wrapper p,
.editor-styles-wrapper pre {
margin: 0;
}
.editor-styles-wrapper button {
background-color: transparent;
background-image: none;
}
/**
* Work around a Firefox/IE bug where the transparent `button` background
* results in a loss of the default `button` focus styles.
*/
.editor-styles-wrapper button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
.editor-styles-wrapper fieldset {
margin: 0;
padding: 0;
}
.editor-styles-wrapper ol,
.editor-styles-wrapper ul {
list-style: none;
margin: 0;
padding: 0;
}
Through a lot of trial and error, I have found that add_theme_support('editor-styles'); is causing the issue.
Once disabled, all the Gutenberg styles return to normal. This is only happening on the our live staging server, locally we are using Vagrant and it is normal.