Similar to conditional rendering , is Conditional Styling of CSS possible?

For example style changes of a Multi page component depending upon the page you are in

1 Like

Hi @karthik :wave:

You can use if and switch statements to style a CSS property differently based on a condition.

Here’s an example with the switch formula but there are many others.

To change the style of a multi-page section depending on the page you’re on, you can use information about the current page you’re on:

1 Like

Yeah I can use the page metadata to apply conditioning for multi page elements. But in that video you are altering the background property with a formula but what I wanted to know is to conditionally inject CSS as code at the bottom [Custom CSS option] is there a way ?

Aaaaah ok ok. Can’t think of one, no.

Can you tell me more about your use case? What would be the CSS styles you’d want to modify with that custom code? Any reason you couldn’t do it in no-code?

1 Like

I did it in no code now. Its a left border styling :sweat_smile:

1 Like

Haha nice one! It’s all in the details :grinning: