Double square brackets notation in CSS files

Double square brackets notation in CSS files

by FUTTERSACK Michel -
Number of replies: 4

hello,

I don't understand the expressions using square brackets in the CSS files like :

h2, h2.main, h3, h4, h5 {
color: setting:headercolor ;
}

in the settings.css file

As I know there are no variables in CSS, then from which language come this notation. PHP, javascript ?

 

Thanks in advance for your explanations

Average of ratings: -
In reply to FUTTERSACK Michel

Re: Double square brackets notation in CSS files

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi,

The code you posted was processed by the filters as it thought you'd posted a link to the moodle docs wiki. Am I correct in thinking that it originally read:

h2, h2.main, h3, h4, h5 {
color: [\[setting:headercolor]] ;
}

Minus the \?

In reply to FUTTERSACK Michel

Re: Double square brackets notation in CSS files

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This is a Moodle-specific notation that works in Moodle 2.0. The CSS you write is pre-processed by the theme system before it is sent to the user, and these tokens are replaced by configuration settings. See Development:Themes_2.0_adding_a_settings_page.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Double square brackets notation in CSS files

by FUTTERSACK Michel -

Many thanks for this link Tim, I will read it carefully and maybe go back to you for more advanced questions !