I am new to Dokuwiki and I am trying to change the default colour of the headers (h1->h6) so that they have the same colour in both the sprintdoc template and while editing the page content in the ckgedit plugin. I was wondering which is the best way to do this, so that I warranty the durability of future updates specially in the plugin? (as for the template, I'm creating my own based on the sprintdoc template). Here some remarks:
1. Given these posts (
https://forum.dokuwiki.org/thread/13642,
https://forum.dokuwiki.org/post/56887), one should ideally create a lib/tpl/sprintdoc/conf/
userstyle.less file, where the new color for the headers is specified. Would be this enough? My
userstyle.less looks like:
h1, h2, h3, h4, h5, h6 {
font-family: Roboto, Arial, sans-serif;
font-weight: bold;
color: yellow;
padding: 0;
line-height: 1.2;
clear: left;
}
which is not working and I would also like to have a variable where I can just set up the colour, instead of hard-coding it.
2. I also noticed that the sprintdoc template has a /css/
base_design.less, where the default style for the headers is defined:
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
padding: 0;
line-height: 1.2;
clear: both;
}
So, I added a new variable
@init_header_color that contains the new color. The new
base_design.less looks like:
h1,h2,h3,h4,h5,h6{
....
color: @init_header_color
....
}
The new
@init_header_color is set/defined in the sprintdoc/
style.ini as:
[replacements]
__header_color = red ; @init_header_color
This already is working fine, but the problem I'm facing is how to use this new variable in conjunction with the ckgedit plugin? Note that the sprintdoc/
style.ini file also includes the stylesheets of the the plugins on
top of the file:
; _____________ plugin styles _____________
[stylesheets]
...
css/plugins/qc.less = all
css/plugins/struct.less = all
css/plugins/structstatus.less = all
css/plugins/bureaucracy.less = all
....
So that I thought, I could create a new file css/plugins/
ckgedit.less and add a line to the
style.ini:
; _____________ plugin styles _____________
[stylesheets]
...
css/plugins/bureaucracy.less = all
css/plugins/ckgedit.less = all
....
In the
ckgedit.less file, I could then use the
@init_header_color, however the variable is defined only after including the plugin styles, and adding that specific new css/plugins/
ckgedit.less at the bottom of the
style.ini file, after having defined my variable, showed me a .css problem. Idea would be something like:
; _____________ plugin styles _____________
[stylesheets]
....
css/plugins/bureaucracy.less = all
[replacements]
....
__header_color = red ; @init_header_color
...
[stylesheets]
css/plugins/ckgedit.less = all
3. Given these
https://forum.dokuwiki.org/thread/10146 and
https://forum.dokuwiki.org/thread/13642, the default .css configuration of the ckgedit plugin is in /lib/plugins/ckgedit/ckeditor/
contents.css How could I re-use the
@ini_header_color variable in that
contents.css file?