Child theme style.css loads before element styles in the Cornerstone preview (order differs from frontend)

Hi theme.co

On the frontend, the child theme’s style.css loads after Cornerstone’s styles:

cs-css → cs-inline-css (element CSS) → x-child-css

In the CS builder preview the order is reversed:

cs-css → x-child-css → cs- … cs-el- (element CSS)

x-child is enqueued at the default priority. In the preview, Styling::outputStyleTag() enqueues each style as a separate cs-<handle> at priority 9999, and the builder inserts the live cs-el-* tags after cs-<doc>-generated . All of them end up after the child stylesheet.

A child theme rule with the same specificity as an element rule wins on the frontend but loses in the builder.

Example:

/* child style.css */
.my-style.my-style { color: green; font-family: MyFont; }
/* element CSS (Text element) */
.e12-3.x-text { color: inherit; font-family: inherit; }

The frontend shows green and MyFont, the builder shows neither. The page looks different in the editor than on the live site.

The preview should use the same stylesheet order as the frontend. For example, Cornerstone’s preview styles could be placed directly after cs, before any later stylesheets.

Hello @Regnalf,

Thanks for writing to us.

Thank you for sharing your feedback! I have passed this along to our development team so they can take a closer look at it. For now, you can customize the styling using the Global CSS, Page CSS, or individual Element CSS boxes, as rules added there will load in both the backend builder and on the frontend. Please have a look at this documentation to learn more about how to write custom element CSS code.

Hope it helps
Thanks