:root not being picked up on templates

This was an issue that we had some time ago. My spacing and sizing are all variables pulling from a stylesheet. Regular units are fine, but backend not displaying any of these values.

Screenshot of backend:

Template Editor

Same blocks copied into a page

A post on the front-end:

Was a problem on the previous version. Persists with the and updates earlier today.

Hello @owynter,

I’m currently unable to reproduce this on my side.
:root variables defined in a Cwicly Global Stylesheet are correctly applying on templates. Are you still experiencing this?

Could you possibly check here (Index template): https://app.instawp.io/wordpress-auto-login?site=$2y$10$j0MHnliba.ZBWLaQqs2XiecOeuzwEJmeV87dtrvBGRuOuB/V8781y

Thanks for taking a look. I went back and scoured all my scripts and CSS and found the issue in one of my stylesheets.

Sorry for the problems.

Is there anyway to build in some error checking? Just something that flashes big, bright and red when we have some errant code - whether CSS or JS or PHP. Don’t know how technically difficult it would be to accomplish, but it would help greatly.

Sometimes it’s just a missing semi-colon, or some other typo that breaks everything.

bonjour @Louis
i have the same issue : i have 2 stylesheets for fluid fonts and fluid spacings, both work on this site https://dev.vivrotop.ch which runs cwicly
and it does not work at all on this site https://ilovebad.fr which runs on cwily

Sometimes it’s as simple as a missing ; that could break your code.

I suggest turning the stylesheet on and off and seeing if there’s a difference.
Next, go through and just (temporarily) delete blocks of CSS bit by bit to see if anything changes. You may be able to narrow down to a bad line, or a small typo somewhere.

It’s frustrating to debug, because you get no cues as to what the issue might be.

Hope that helps.

oh god you’re right… it was not a missing ; but a comment which was not marked as a comment…

1 Like

Hi @pomilo,

Great to see you got this fixed.
It’s definitely a good suggestion @owynter to warn the user there’s an error in the stylesheet.

We have tried a few things on our side but they always seemed a bit too intrusive, and it’s rather difficult to find the perfect spot when a user is simply trying to type his rules & properties in.

What might be best here is an auto check when the Editor is first loaded (with a warning if there is something wrong), then allow the user to call a manual check of all stylesheets further on.

Moving to General.

I know you try to walk the fine line between giving us all the freedoms, but still maintain some guardrails, while making sure that Cwicly doesn’t become being too opinionated. I appreciate that you’re always considering the options.

A solution that gives us the opportunity to manually check all our code would be a great addition. It also shouldn’t be much of a performance hit since we run it only as needed for debugging.

I run my snippets through validation (I’ve been liking ChatGPT for this purpose) to catch minor errors. The missing piece sometimes is that the code, while semantically correct, might still cause issues elsewhere in Cwicly, which no outside system could be able to foresee.