4 * Makes our changes to the CSS
7 * @param theme_config $theme
10 function nimble_process_css($css, $theme) {
13 if (!empty($theme->settings
->linkcolor
)) {
14 $linkcolor = $theme->settings
->linkcolor
;
18 $css = nimble_set_linkcolor($css, $linkcolor);
20 // Set the link hover color
21 if (!empty($theme->settings
->linkhover
)) {
22 $linkhover = $theme->settings
->linkhover
;
26 $css = nimble_set_linkhover($css, $linkhover);
29 // Set the background color
30 if (!empty($theme->settings
->backgroundcolor
)) {
31 $backgroundcolor = $theme->settings
->backgroundcolor
;
33 $backgroundcolor = null;
35 $css = nimble_set_backgroundcolor($css, $backgroundcolor);
45 * Sets the link color variable in CSS
48 function nimble_set_linkcolor($css, $linkcolor) {
49 $tag = '[[setting:linkcolor]]';
50 $replacement = $linkcolor;
51 if (is_null($replacement)) {
52 $replacement = '#2a65b1';
54 $css = str_replace($tag, $replacement, $css);
58 function nimble_set_linkhover($css, $linkhover) {
59 $tag = '[[setting:linkhover]]';
60 $replacement = $linkhover;
61 if (is_null($replacement)) {
62 $replacement = '#222222';
64 $css = str_replace($tag, $replacement, $css);
69 function nimble_set_backgroundcolor($css, $backgroundcolor) {
70 $tag = '[[setting:backgroundcolor]]';
71 $replacement = $backgroundcolor;
72 if (is_null($replacement)) {
73 $replacement = '#454545';
75 $css = str_replace($tag, $replacement, $css);