Needs work
Project:
Drupal core
Version:
main
Component:
Olivero theme
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Aug 2022 at 19:19 UTC
Updated:
1 Dec 2025 at 08:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mherchelComment #3
wim leersYes please! I'd love to use Olivero as the starting point for the D10 version of
wimleers.com🤓 (Which I'll make happen hopefully some time later this year…)Does this need work in Olivero itself, or in the theme generator infrastructure?
Comment #4
mherchelMy understanding is that this needs to happen within Olivero. But TBH, i'm not sure what the first steps are.
Comment #5
wim leersLet's find out.
Comment #6
lauriiiYes, this needs to happen within Olivero. Olivero will need to implement
\Drupal\Core\Theme\StarterKitInterfacesimilar to\Drupal\starterkit_theme\StarterKitwhich will handle post process steps required for Olivero.We need to decide what to do about the Olivero color changing when the theme generator is used. We need to decide if we want to copy all of the logic to the generated theme or if we should try to abstract that feature to a module.
Olivero uses PostCSS for its CSS. I guess we should also generate tooling for the generated theme so that the owners of the new theme will be able to rebuild the CSS.
Comment #7
mherchelComment #9
itamair commentedI am also testing the Olivero theme in my new Drupal 9 project (candidate to 10 ... ), and I was trying to understand how to fork/subtheme it,
and then being able to customise it to my specific needs,
when I figure out that it doesn't really support it, yet.
Looking around I found this: https://github.com/mherchel/olivero-subtheme
and I have been able to take advantage of its "manual" procedure (pretty obvious, I know, and also not an immediate process, due to the many "find & replace"s to carefully process ), and fixing all the mistakes and the missed ones.
Unfortunately its bash script doesn't work properly: a lot of files are not properly cloned.
Anyway its yarn commands (defined in the package.json file) work pretty well, especially in managing (altering / extending / customising) its *.pcss.css files.
I know that I am in not an ideal situation ... as I will probably miss / mismatch all the still ongoing devs in Olivero (before the first official release of Drupal 10 on the 14th of December). But that was the most reasonable approach I found so far to have the Olivero really adoptable ... and not only for a curious look at it.
Olivero looks really cool to me, with its Grid responsive system, and almost ready to go state.
Hence really looking forward for a forthcoming implementation of a starterkit for it ...
Comment #10
ressaHere's my attempt at a sub-theme tool for Olivero, which should work: #3214072: Provide an Olivero sub-theme creation tool.
Comment #12
andy-blumAdding testing instructions to the IS.
Comment #13
mherchelThis is AWESOME!
I found one major error and several @todos . Once I manually fixed the prerender thing, it worked as expected, including the color changing!
post_update.phptests/srccore/themes/olivero/src/OliveroPreRender.phpis not renamedcore/themes/olivero/src/OliveroPreRender.phprenamed has invalid PHP in the classnameComment #14
andy-blumHonestly, I think there are several improvements to the starterkit script that we could make:
An additional to-do: we probably want to remove the starterkit class from the generated theme as well.
Comment #15
andy-blumComment #16
andy-blumComment #17
andy-blumLatest updates:
Comment #19
mherchelThe
themename_element_info_alterwithin the *.theme file is still malformed.In this example, the theme was generated with
Comment #20
andy-blumLatest changes find-and-replace class names first.
Comment #21
andy-blumGot the build-step files in from core. Still needs tests, but ready for review!
Comment #22
mherchelSetting to Needs Work because of CSpell error
Comment #23
mherchelJust tested out the latest diff and aside from the minor error above, it looks perfect! I tested out various theme settings, as well as the PostCSS compilation step.
Question: We need a readme file in there that details the PostCSS compilation steps as well as other pertinent information. What's the best way to provide this without easily exposing the readme directly within Olivero? Maybe we should create a newThemeReadme.md in the
srcdirectory, and then copy, rename, and modify it when doing the theme generation process?Comment #24
aaronmchaleJust chipping in, as someone who has subthemed and modified Olivero, having the steps there to compile PostCSS would be hugely valuable, as it wasn't entirely clear what the best way to do it was.
So I just ended up creating a custom stylesheet and not touching the PostCSS. Not a huge issue as I only had to make minor modifications, but having the steps to compile the PostCSS right there in the theme, would have made my life slightly easier.
Comment #25
andy-blumComment #26
andy-blumAdding #788332: Provide a parser for THEME.colors.yml as a related issue. It would be nice to get that in place before this issue so site builders don't have to duplicate & maintain their own theme coloring functionality.
Comment #27
balsamaJust tested this out myself and it worked great. I did encounter one error when trying installing theme dependencies after generation:
This turned out to be due to the fact that I passed a value to the `--name` option when generating the theme that contained spaces. This resulted in the package.json file having a name value that contained spaces. E.g.:
...which `yarn install` apparently doesn't like.
The full command that I ran that ultimately resulted in the error was:
Comment #28
ressaGreat work @andy-blum! I just tried the command which works well, as @balsama also wrote. I see the same Yarn error, which happens because the theme name is used in
package.json, where the machine name would work better:From Creating a package.json file.
Currently in
package.json:After the update (66d7562d - Use machine name ...):
After switching to using the machine name, I can generate a new theme, update for example the font in
css/base/variables.pcss.css, and generate new CSS files, which take effect in the new theme.Comment #29
andy-blumTests still need work - letting the test runner do the first nightwatch test to see if it passes 🤞
Comment #30
andy-blumComment #31
andy-blumWe're running into some issues here that I'm not sure how to fix - to this point I've been unable to get the PHP setup function to run before the nightwatch tests.
This line of the MR should be creating a new theme, using Olivero as a starterkit, but either that's not working, or we need to dump the cache before we move on, because the ThemeInstaller can't find our new theme.
Comment #32
andy-blumFrom Drupal Slack:
@mherchel
@bnjmnm
Comment #33
scotwith1tThat was so easy, thanks so much! I've been trying to stick with just core stuff for a simple site and ended up needing to customize just a little of the css and templates, so this was a huge win for my site. Thanks!
Comment #34
itamair commentedThanks a lot on this! This is already pretty useful ...
BUT I have faced some important issues trying to generate a custom theme of mine with this starterkit from Olivero, when using a machina name with underscores and a label/name with spaces inside it.
For instance the following command:
php core/scripts/drupal generate-theme my_custom_theme --name "My Custom Theme" --starterkit oliverogenerated weird duplications and mismatches in the names of the generated files and also a pre-render class name with spaces ...
(nothing really usable)
The only working solution with this has been (so far) to create/use a theme with both machine name and name without underscore or spaces, such the following:
I could make it work, but is indeed not ideal ...
Comment #36
andy-blum@itamir can you point to any specific examples where you encountered problems? I copied your example command and got perfectly valid results. I was able to fully install and set the new theme as default and browse the site without issue.
Comment #37
itamair commentedHi Andy … well ok … sorry!
Donno what was it, how I experienced those weird behaviours, but I re-tested this few times more, and all LGTM now.
I am on a new Macbook ARM M2 and recently made some updates in my composer etc etc ...
Indeed now this looks neat and good to me.
I was able to start / fork 3 themes from Olivero, very quickly and with no apparent issues.
+1 for RTBC by me
(and thanks for this great work)
Comment #38
andy-blumNow that the theme switching function from #3293469: Automated A11y tests in Nightwatch has landed, I've added it into our new
testPerTheme()function. 🤞Comment #39
andy-blumComment #41
wombatbuddy commentedThemes are created and installed successfully, but if their name does not contain the word "olivero". For example, if the theme's name is "custom_olivero" then there are issues with namespaces. Maybe it make sense just notify users about this in some doc?
Comment #42
smustgrave commentedSeems there are failures in the MR
Comment #44
andy-blumMoving this to postponed as the starterkit tool theme is currently undergoing a re-write in #3364885: Allow themes to use a starterkit.yml file so it is easier to use the theme generator. When that's done all Olivero should need to do is update .info.yml and add a .starterkit.yml file
Comment #46
wim leersHow is this not ?! 🤯
Also, this is blocked on #3364885: Allow themes to use a starterkit.yml file so it is easier to use the theme generator, which itself is blocked 😅
Comment #47
wim leers… it's blocked more than I thought 😅
Comment #48
andy-blumSymfony's finder & filesystem components are now full runtime dependencies [CR]
Comment #49
andy-blumNow that #3364885: Allow themes to use a starterkit.yml file so it is easier to use the theme generator is in, this is unblocked!
Comment #53
4aficiona2 commentedIs it somehow possible to use/clone Olivero as a starterkit theme? Maybe with a patch since it hasn't made it into Drupal 11 yet.
For Drupal CMS there is the
drupal_cms_oliverotheme which itself uses Olivero as a base theme and which is not recommended like the module itself states indrupal_cms_olivero.info.yml.What is the proposed solution for Drupal CMS and Olivero and the build setup (CSS/JS/img optim) once Olivero got actually cloned? I would like to reuse the the 'menu' with it's a11y features.
Thanks for guidance.
Comment #54
freddy rodriguezSame question here for D11.1 core.
php core/scripts/drupal generate-theme mycustomtheme --name MyCustomTheme --starterkit olivero
[ERROR] Theme source theme olivero is not a valid starter kit.
Comment #55
lostcarpark commentedI'm eagerly awaiting this issue to be ready for testing. I managed to patch Olivero to create a subtheme back under D9, but the patch wouldn't work for me in D10.
As a stop-gap, I've been using Jean Valverde's Olivero Subtheme Project. It links to this issue, and warns that it will soon be obsolete, but it doesn't seem to be quite yet!
I fully expect to recreate my subtheme as a Starterkit theme when possible, but just now Jean's project seems to be the best option for Olivero derived themes.
Comment #56
4aficiona2 commentedWhats holding this back? It's quite frustrating to see no progress here since a long time. In general, if Drupal "finally" wants to (re)attract (more) Frontend people the frontend topics should also be addressed like any other issue. Since my D6 days, the frontend has always been the stepchild ... I don't want to rant, but I'm actually a bit frustrated since I came back to Drupal after a while being away (for reasons) and things seem to be the same as they were in Drupal Frontendlandia. SDC is nice (for components), but we need a theme too (to glue it all together) ... marketing says it all changed but it unfortunately hasn't. Don't get me wrong and this is probably the wrong place to address this but on the otherhand it's also a core thing/theme where alot of effort already went into so why not reusing this great work and making it available for everybody? Navigation/focus management is key for websites a11y ... probably the navigation/focus handling needs to be extracted/provided as a own navigation module which then can be integrated/combind in any theme.
Comment #57
mherchelPretty sure we need some comprehensive tests.
I hear that. But since D10, we've made a lot of improvements including a better dump(), UI for enabling twig debugging, some great new twig filters, and of course SDC
That's in progress now. See https://www.drupal.org/about/starshot/blog/announcing-the-selected-partn...
Not sure this is possible. Obviously focus states are important, but so is order. But yeah, I hear you.
Comment #58
freddy rodriguezYou can install this theme:
https://www.drupal.org/project/drupal_cms_olivero
Once installed, you can override anything you need in a custom theme.
Comment #60
andy-blumComment #61
andy-blum@deviantintegral joined me in a pairing session to step-debug the test failures.
Comment #63
deviantintegral commented@andy.blum and I took some time to debug this. I pushed up a commit that moves the generation to before the site installer, but it may not be needed.
We determined that the core issue has to do with the APCu class resolver cache. For example, if you run:
The first test case will pass, and the second will fail being unable to resolve
\Drupal\test_custom_theme\TestCustomThemePreRender.!!!
It figures, in writing this out I realized what's happening!
The test theme is being generated in the simpletest directory, which is good so we have a clean state. But, the autoloader is caching the resolution of that class lookup, and then we remove that directory in future tests which get a new test ID.
This strikes me as being a problem with any test that is doing per-site multisite style themes or modules. Yet, the default apcu prefix should use the hash_salt, which in tests is the database prefix. There's still something else missing here.
Comment #64
deviantintegral commentedWe discovered what appears to be an unrelated bug. If you enable a theme in the UI, component caches aren't cleared so the new components aren't usable. @andy.blum is going to push up a workaround that installs the theme first from the CLI during the site install. I've filed #3522505: New SDC components are not available when enabling themes through the UI.
Comment #65
andy-blumComment #66
mherchelRunning this thing through its paces 🤞
Comment #67
mherchelThis works perfectly!
I ran the command in ddev, and worked as expected.

The theme appeared under the appearance route as expected.
I played around with it and tried to break it, and it worked great!
Comment #68
alexpottThis is such a nice idea. +1
Added some comments to the MR - we shouldn't be adding return typehints in this MR.
Comment #69
alexpottOne thought is doing we really need to run all the nightwatch tests against Olivero and a starterkit theme - doing so is going to double our Nightwatch testing time as far as I can see. Maybe we only need to run the most generic of tests - or maybe we only need to run against a generated theme?
Comment #71
kartagisDo we have an ETA on this?
Comment #72
simohell commentedI have trouble building the CSS in the 11.x branch. It used to work with Drupal 10, I think, at one point but now I seem to be getting:
UndefinedParserError: No parser and no file path given, couldn't infer a parser.which is an error message from prettier.
Anyone else come across this one?
This comes up at compile.js starting at line 75 in compile.js (the one with return).
Compiling Olivero CSS in core works, so there must be something with the paths ore some dependencies, I guess.
Another thing with the copies scripts is a more simple one:
For watch:css we have a set of paths to watch in postcss-watch.js
const watcher = watch(['./themes', './modules', './profiles'], {but for the starterkit theme those folders don't exist but we should use something like
const watcher = watch(['./css'], {