JuKu / JuKuCMS

Open Source CMS should be the fastest CMS world wide (WIP).
Other
5 stars 1 forks source link

CSS Customizer #202

Open JuKu opened 5 years ago

JuKu commented 5 years ago

Maybe we can introduce a css customizer where we add a customizer.json to style directory and add options, which can be changed by users.

Something like this for example:

[
    {
        "option": "background_color",
        "title": "Background color",
        "default": "#FFFFFF"
    }, {
        "option": "text_color",
        "title": "Text color",
        "default": "#000000"
    }
]

This values can be changed in admin area. On installation, default values will be set from customizer.json or custom values overrides them.

And in stylesheet files developers can use template variables like this:

body {
    font: normal .80em 'trebuchet ms', arial, sans-serif;
    color: {$customizer.text_color};
}

Because css files will be parsed only once and then cached, this doesn't has any effect on performance after second website load.

JuKu commented 5 years ago

@PascalReintjens Any suggestions?