Problem/Motivation
The removal of Classy as base theme in 3.x also results in the removal of most classes, so that for example inline field labels don't display inline.
Users can set the display of the field label to be "Above", "Inline", "- Hidden -" or "- Visually Hidden -". In version 3.0.0-rc1 of this theme, setting it to "Inline" has no effect. This worked in version 2.0.6. See screenshot below.

This is then breaking a built-in Drupal behaviour.
Steps to reproduce
Have a content type with some fields. Set the label for at least one of them to "Inline". Observe that this has no effect.
Proposed resolution
I suspect this is because the classes field__label and field__item are missing from the 3.0.x version. Inspecting the markup I get:
Bootstrap5 ver. 2.0.6:
<div class="field__label">Shortname</div> <div class="field__item">advanced_help</div>
This is also the markup up field label and item I get with the core Olivero theme.
Bootstrap5 ver. 3.0.0-RC1:
<div>Shortname</div> <div>advanced_help</div>
Restore these classes.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | after fix.png | 105.06 KB | jannakha |
| #13 | before fix.png | 93.01 KB | jannakha |
Issue fork bootstrap5-3333397
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ressaIt looks like most classes are missing, after the removal of Classy as base theme. In Drupal 9, the classes are back, and everything looks fine, if I in bootstrap5.info.yml change
base theme: falseto
base theme: classyThis won't work in Drupal 10, since Classy theme is deprecated and has been removed.
I think the cause is the same in #3333424: Regression: Gutters are zero width, which perhaps can be closed as a duplicate?
Comment #4
ressaI found an issue (#3329904: Classy theme is deprecated in Drupal 9.5 and will be removed in Drupal 10) about the same challenge, where @davedg629 suggests restoring Classy as base theme. He quotes the Classy project page, which says:
I tested this by restoring Classy as a base theme and dependency in bootstrap5.info.yml, downloaded and enabled it, and it seems to work in both Drupal 9 and Drupal 10, where the missing classes are restored.
I created a patch as a proof of concept, but am not sure if testing the downloading of it and the required theme Classy with Composer is possible ... probably not. For manual testing, apply the patch and then:
Comment #5
vladimirausThanks for the commit. 🥂
We can't reply on classy support moving forward.
We need to start updating SCSS/CSS without reliance on Classy.
Please introduce CSS issues separately with screenshots.
Parent issue with instructions: #3331443: Add required SCSS/CSS fixes after removal of Classy and Stable
Comment #6
ressaCould we use Starterkit theme as base theme instead? I have updated the patch, and after enabling the Starterkit theme and clearing caches, the classes are back:
drush theme:install starterkit_themeComment #7
vladimiraus@ressa - don't think it is a good idea to enable starterkit.
It is hidden for a reason.
Maybe better try to generate new starterkit theme and see what's the difference?
Comment #9
vladimirausSo I generated theme using
starterkit.It copies bunch of css and templates as well as defined some libraries.
So I copied
I also added
stable9as base theme.Check out my merge request.
Don't forget to run
./vendor/bin/drush -l default theme:install stable9I think it might be a good start.
Comment #10
ressaThanks @VladimirAus, though it doesn't fix this issue, as far as I can tell ...
Just before your MR, I added a smaller MR !26, which just adds a Twig-file for field and the CSS. I had a look to see where the classes come from, which were these two files. They are identical in both Classy and Starterkit themes, as can be seen by the empty
diffresults:I added the two files in the patch, and registered the CSS file in bootstrap5.libraries.yml.
There are many more twig-files in a fresh Starterkit (85) compared to Bootstrap5 (29):
Bootstrap5 (after adding field.html.twig template):
A default Starterkit theme:
So we probably need to figure out which of these 85 Twig-files need to be added ... or just add all of them, in one fell swoop?
Comment #11
vladimiraus@ressa I moved all the templates from starterkit and fixed most of teh issues.
Please let me knwo if it fixes yours.
Comment #12
vladimirausFew additional fixes.
Comment #13
jannakha commentedTemplates have been created as a part of this MR:
- templates set classes for entity's HTML, eg node-* field-*
- these classes are used to apply styles
Ready to merge
Comment #14
jannakha commentedupdated status after review (see prev comment)
Comment #17
vladimirausThank you! Committed! 🥂
In the end added final check on update hook.
Comment #18
vladimiraus