Dynamic CSS goal is a bit as a LESS compiler : using variables in place of static declarations. But CYJS uses internal Javascript variables inside cyCSS array for dynamic substitutions, no need to compile or to do anything else then using %variable_name% in place of usual declarations, as for example font-family: ‘%Font%’ in place of font-family: ‘Open Sans’

When loading a page, its CSS part will be automatically parsed, and all %pattern% will be replaced by the corresponding cyCSS.pattern value.

The CYLoadCSS() function does the job automatically, nothing else to do. Note that if you call CYLoadPage(), the corresponding CSS file if it exists will be automatically loaded then parsed that way.

sidemenu {
    position: fixed;
    border-right: 1px solid %BorderColor%;
    background-color: %ButtonBackgroundColor%;
    z-index: 99998;
    overflow-x: hidden;
    overflow-y: auto;

In your config.js file, you just have to set :

  • cyCSS.BorderColor = “#333333”;
  • cyCSS.ButtonBackgroundColor = “#007fff’;

Note that the commented values in the standard config.js file are the default values used by the framework. If you don’t like our blue, just uncomment them and change all #007fff by something else, and everything will be updated after reload.