Now we have following problem, we have set our heading styles in the FSE, they are loading correctly but the Tailwind default styling overwrites the FSE styling.
This is our app.css
@tailwind base;
@tailwind components;
@tailwind utilities;
@media (wp-editor) {
/* Style is ONLY in editor CSS */
.your-styles-here {
color: blue;
}
}
So in your example, element selectors are used by the theme that have less specificity than CSS class selectors (assuming that tailwind classes are used). When you inspect the DOM elements that are not styled by the theme CSS, you should see how those CSS properties are formatted strikethrough, as they are overriden by the tailwind ones.
I just came across the same problem in the “non FSE” Sage theme when setting element styles within bud.config.js.
Once thats written to theme.json the CSS specificity problems arise, since the tailwind styles, from their own CSS reset in that case, appear later in the cascade.
I used the same workaround as @jarirengeling for now, but would be interested if anybody has another solution to that problem. In the Tailwind Docs they also mention to just override the reset, so I guess thats probably the best way to do it.
So I had a similar issue (I do not use tailwind), with normalize styles. Those styles overrode the Gutenberg global styles. A solution was separating out those styles and moving them (in source/CSS order) above the Gutenberg global styles. This was achieved by using WordPress hooks and manipulating the enqueued styles order.