This shows you where to put a few lines of custom CSS on a Solo site, and — just as usefully — when not to use that field.
Three fields, three different destinations
They all live together under Global Site Settings → Custom Code, and the difference between them is where the code ends up:
- CSS Injector — minified and printed straight into the page head inside a single
<style id="solo-css-injector">element, on every page. Nothing is written to disk. - CSS Dynamic — saved as a real file at
sites/*/files/solo/css/solo-css-dynamic.cssand attached as a library, so it is cached and aggregated like any other stylesheet. - JavaScript Dynamic — saved to
sites/*/files/solo/js/solo-js-dynamic.jsand loaded deferred, with jQuery, Drupal behaviors,drupalSettingsandoncealready available to it.
Choosing between the first two
Use the injector for a handful of declarations you want to see immediately — it survives no build step and takes effect the moment you save. Move to CSS Dynamic once the snippet grows, because an inline block is re-sent with every single page while a file is fetched once and cached. If your override is not winning at all, the problem is usually specificity rather than the field; the sub-theme CSS troubleshooting guide walks through diagnosing that.
What happens when you press Save
- The values are written to Solo's configuration.
- The dynamic CSS and JS files are rewritten — or deleted, if you emptied the textarea.
- The global asset query string is reset so browsers do not serve a stale copy.
- The theme registry, library discovery and Twig caches are cleared for you.
If you run a strict Content-Security-Policy
The CSS Injector is the only inline <style> element Solo ever emits, and only when the field has content — leave it empty and there is none, which matters if you would otherwise need style-src 'unsafe-inline'. The generated JS file is loaded as an external same-origin script, so script-src 'self' covers it. Solo runs on ^10.1 || ^11 || ^12 with PHP ^8.1; see the theme page.
If you would rather have this set up for you, Drupal theming services covers the work, and recent projects show the result.