Add accent color support to the theme

This commit is contained in:
Kazhnuz 2025-07-14 11:24:49 +02:00
parent 4d24c21a41
commit 959c3701aa
13 changed files with 82 additions and 2 deletions

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #0c8599; /* valeur 8 */
--accent-color-dark-hover: #0b7285; /* valeur 9 */
--accent-color-light: #c5f6fa; /* valeur 1 */
--accent-color-light-hover: #e3fafc; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #9c36b5; /* valeur 8 */
--accent-color-dark-hover: #862e9c; /* valeur 9 */
--accent-color-light: #f3d9fa; /* valeur 1 */
--accent-color-light-hover: #f8f0fc; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #2f9e44; /* valeur 8 */
--accent-color-dark-hover: #2b8a3e; /* valeur 9 */
--accent-color-light: #d3f9d8; /* valeur 1 */
--accent-color-light-hover: #ebfbee; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #3b5bdb; /* valeur 8 */
--accent-color-dark-hover: #364fc7; /* valeur 9 */
--accent-color-light: #dbe4ff; /* valeur 1 */
--accent-color-light-hover: #edf2ff; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #66a80f; /* valeur 8 */
--accent-color-dark-hover: #5c940d; /* valeur 9 */
--accent-color-light: #e9fac8; /* valeur 1 */
--accent-color-light-hover: #f4fce3; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #e8590c; /* valeur 8 */
--accent-color-dark-hover: #d9480f; /* valeur 9 */
--accent-color-light: #ffe8cc; /* valeur 1 */
--accent-color-light-hover: #fff4e6; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #c2255c; /* valeur 8 */
--accent-color-dark-hover: #a61e4d; /* valeur 9 */
--accent-color-light: #ffdeeb; /* valeur 1 */
--accent-color-light-hover: #fff0f6; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #e03131; /* valeur 8 */
--accent-color-dark-hover: #c92a2a; /* valeur 9 */
--accent-color-light: #ffe3e3; /* valeur 1 */
--accent-color-light-hover: #fff5f5; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #099268; /* valeur 8 */
--accent-color-dark-hover: #087f5b; /* valeur 9 */
--accent-color-light: #c3fae8; /* valeur 1 */
--accent-color-light-hover: #e6fcf5; /* valeur 0 */
}

View file

@ -0,0 +1,6 @@
:root {
--accent-color-dark: #f08c00; /* valeur 8 */
--accent-color-dark-hover: #e67700; /* valeur 9 */
--accent-color-light: #fff3bf; /* valeur 1 */
--accent-color-light-hover: #fff9db; /* valeur 0 */
}

View file

@ -3,5 +3,7 @@
{
"name": "Default",
"description": "Le theme par défaut de koblog, inspiré par l'ancien de wordpress"
}
},
"accent-color":"Couleur d'accent",
"change-the-accent-color-on-the-whole-theme":"Change la couleur d'accent pour le theme entier"
}

View file

@ -13,6 +13,9 @@
<!-- Include CSS Styles from this theme -->
<?php echo Theme::css('css/style.css'); ?>
<?php if ($themePlugin->getValue('accentColor') != "default") : ?>
<?php echo Theme::css('css/'.$themePlugin->getValue('accentColor').'.css'); ?>
<?php endif ?>
<!-- Load Koblog Plugins: Site head -->
<?php Theme::plugins('siteHead'); ?>

View file

@ -7,7 +7,8 @@ class defaultTheme extends Plugin
{
$this->dbFields = array(
'showPostInformation' => false,
'dateFormat' => 'relative'
'dateFormat' => 'relative',
'accentColor' => 'default'
);
}
@ -17,6 +18,20 @@ class defaultTheme extends Plugin
$html .= PluginSettings::bool($this, 'showPostInformation', 'Show Post Information');
$html .= PluginSettings::values($this,'dateFormat', 'Date format', ['noshow'=>'No show', 'relative'=>'Relative', 'absolute'=>'Absolute'], 'Change the date format for the main page.');
$html .= PluginSettings::values($this,'accentColor', 'Accent Color', [
'default'=>'Blue',
'red'=>'Red',
'pink'=>'Pink',
'grape'=>'Grape',
'violet'=>'Violet',
'indigo'=>'Indigo',
'cyan'=>'Cyan',
'teal'=>'Teal',
'green'=>'Green',
'lime'=>'Lime',
'yellow'=>'Yellow',
'orange'=>'Orange'
], 'Change the accent color on the whole theme.');
return $html;
}