Changing CSS size property based on CMS


I would like to know if it’s possible to change the width size property of a div block (in vw) based on a width setting i’ve put in the CMS so it changes for every div based on the CMS. For example one element would be 25vw width based on what I’ve put in the CMS and another would be 40vw width based on what I’ve put in the CMS.

Here is my public share link: LINK
(how to access public share link)

You could have a field that had a class name for example, which could be programmatically added to an element with custom code. You could set the values of each class on a style guide page.

I built this example in the past:

Example read-only

Hello, thanks for the reply and solution! I’ve just been able to solve it in another way though by duplicating the divs each with their own size properties and giving them absolute position and stacking them one on top of the other. I then gave each one a conditional visibility that they would only show if the name in the cms matches the correct div name with the right width property.