Developer forum

Forum » Development » Custom logic for creating CSS classes and definitions

Custom logic for creating CSS classes and definitions

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a request for optimizing the admin's activity where I need to create a set of editable elements that in turn would generate some CSS rules.

Something very similar to how the Themes work.

I can handle the Itemtype definitions but I have no idea how I can create the connection between ItemType fields and CSS definition and create the associated CSS rules and file.

Is this something that can be configured somehow or it is built in the compiled code of Swift?

Thank you,
Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Adrian

Not sure I understand your question - but Swift does it very simple by creating a text string and writing it to css file from a template:

https://github.com/dynamicweb/Swift/blob/main/Swift/Files/Templates/Designs/Swift/Swift_Branding.cshtml

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

That's what I was looking for.

Then my next question is how is this Updated? Is there a scheduled task accessing this page to generate the file? Do I always need to preview the page if I want the CSS file to be updated?

Thank you,
Adrian

 

   
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Cool!

Thank you very much.
Adrian

 

You must be logged in to post in the forum