I learned to code in the prehistoric ages where where HTML would be crafted like <font size="2">Hello Dinosaurs</font>. Yet, even in those days, the ‘font’ tag was deprecated. When CSS brought us the split in content and styling, it enabled us to let clients deal with content, while designers and developers dealt with the way it was represented. Lovely.
The issue with X/Pro
In the past years Theme.co released us from the burden of having to develop the same elements again and again, by developing X and Cornerstone, a page builder that actually worked. However, it also reintroduced inline styling. While the CSS is now technically rendered outside the element, the ‘inline’ issue remains apparent.
Let’s slap a button on a page in X. Don’t change any styling and the Chrome inspector will show you the following:
<a class="e1138-6 x-anchor x-anchor-button" tabindex="0" href="#">
<span class="x-anchor-content">
<span class="x-anchor-text">
<span class="x-anchor-text-primary">Hello Dinosaurs</span>
</span>
</span>
</a>
And the CSS:
.e1138-6.x-anchor {
border-radius: 0.35em;
font-size: 1em;
background-color: rgba(255,255,255,1);
box-shadow: 0em 0.15em 0.65em 0em rgba(0,0,0,0.25);
}
Developing a website with a team implies the use of a code repository, like Github, were you maintain your code. If you want to change, lets say, the border-radius for all the buttons on your website you would regularly to the something like:
a.x-anchor {
border-radius: 0;
}
But, since X renders pseudo-inline CSS (in the index file) we’re forced to use !important for every change that we want to be persistent. There is no valid reason for this. We did not add any styling to the element in X. It’s even worse, the roundness of the corners can not be changed in X > options > buttons, nor on a page level where we add the button. If the developers at Theme.co would have put their styling in ‘integrity-light.css’, our code would have priority over stack’s styling.
If we want code clean, we want to avoid using !important. We want to avoid clients making design changes and keep design separate from the content. Effectively X sends us back to the age of ‘Hello Dinosaurs’.
How to fix it
The magic option that would solve all of this would be a global setting:
[ ] enable inline css
Following ThemeCo’s recent philosophy in the way stacks are applied, this would be a ‘default’ for all pages. People with certain roles, like editors, could still be able to to re-enable this on a page-level. We could still have that special campaign page with alternate styling. Authors, or contributors would be able to deal with the content, knowing they will not break the design.
Please, please, pretty please
Start by moving all default styling to the chosen-stack.css file. So we can work in teams and still keep using those awesome features of X/Pro & Cornerstone.
Keep the index free of pseudo inline CSS, unless explicitly defined in X.
Thank you.
