Hi @b.da
It's true that your approach is simpler, but this way you save the css styles in a .yaml file, and then insert them as inline (with addInlineCss), but that's not what I'm looking for.
The Editorial theme, for example, already has code in the main theme file like this:
public function onTwigSiteVariables()
{
if ($this->isAdmin() && ($this->grav['config']->get('plugins.shortcode-core.enabled'))) {
}
$themeConfig = $this->config->get('themes.editorial');
if (isset($themeConfig['custom_css']) && $themeConfig['custom_css'] && file_exists(__DIR__ . '/assets/css/custom.css')) { $this->grav['assets']->addCss('theme://assets/css/custom.css', ['priority' => 5]);
}
}
which loads the custom.css file from the theme path /assets/css/custom.css.
I don't want to load the inline styles, that would be fine for use with a few styles.
The idea of the 'Editor' plugin is what I'm looking for, but the approach of this plugin is very broad, including Twig, CSS, JS, etc, and all folders of the site, not just the theme. I will have to investigate this plugin to extract the code needed to load only the custom.css file in the theme and be able to modify it and save it from the theme itself (not in a .yaml file).
Thanks for your help.