Can CMSB be used to generate SASS or LESS files for the purpose of color selections etc in a website?

3 posts by 3 authors in: Forums > CMS Builder
Last Post: June 24, 2016   (RSS)

By Damon - June 24, 2016

I haven't worked with SASS or LESS before. If the goal is just to have a number of variables in the style sheet that can dynamically changed in CMS Builder, that can be setup. 

Create a single section editor with fields for all the variables you want. The add the publish code for those variables into the stylesheet and save it as .php.

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Toledoh - June 24, 2016

You could use CMSB to edit the variables in a LESS or SASS file, but you would then need a server-side compiler like Node.js or Rhino as the LESS file will need to be processed into CSS.

I use CMSB to create XML files, and call them (for instance) sitemap.xml.php to allow the PHP to run.  I guess you could have (for instance) variables.less.php, but I'm not sure if the compiler will recognise it as a less file?

Depending on how far you want to go, it may be easier to insert variables directly into the CSS file using style.css.php which would really achieve the same thing?

Cheers,

Tim (toledoh.com.au)