Since working with Blocs 5 and now 5 I’ve noticed recurring issues with background colours that fail to apply to elements when a page is loaded a second time on the server. It’s bizarre what happening here, but I think it something to do with CSS var is not set?
Example…
I apply a background to a link style on a button.
Publish to the server reload the page in a browser. Perfect. I see the background colour applied.
I reload the same page again and boom! the background colour has disappeared. Looking at the browser inspector the var colour show as dimmed with the error… var (colour name) is not set
To fix this issue I specifically have to disable both the following on the CDN CSS Optimisation…
Flatten CSS Imports (Medium Risk)
Reduces the number of HTTP round-trips by combining multiple CSS resources into one.
Rewrite CSS (Medium Risk)
Parses linked and inline CSS, rewrites the images found and minifies the CSS.
Could it be this is something to do with how Blocs is using vars for colours? I’ve never had this issue before with the CDN with other Apps or hand coded websites. Only Blocs.
I’ve had no end of issues using colours in Blocs so this is a fix of sorts.