Closed (fixed)
Project:
Bootstrap5
Version:
4.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Jan 2023 at 15:23 UTC
Updated:
3 Mar 2026 at 23:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
vaibhav_arora commentedI have added fixes and created patch for the above HTML element border issue, and also attached the screenshot for reference.
Comment #3
vaibhav_arora commentedComment #4
abyss commented1. It is INCORRECT to change styles in dist, as it contains clean files from the Bootstrap theme.
2. It is not correct to update styles only in the css file, as they will be overwritten after compiling the scss styles.
3. You should update not the details component with the class "card", but the summary tag with the class "card-header".
Comment #5
abyss commented@VladimirAus & @jannakha, a question for you, maybe we should update the details.html.twig template, because at the moment this template uses classes of the card component, although it looks and performs the functionality of the accordion component.
Or is it simple to update the styles for the summary tag of this template?
Comment #6
abyss commentedComment #7
ravi kant commented@abyss if border class 'border-0' will be added directly on details.html.twig then the border of details will be removed. The issue is on collapse due to the summary tag having a border that should remove when the details tag closes so I have created a patch according to it.
Comment #8
ravi kant commentedComment #9
abyss commented@ravi kant
Comment #10
ravi kant commented@Abyss
Adding new patch but whole style files is updated for white space. I have checked with 'sass scss/style.scss css/style.css' and 'npm run build:sass'.
Comment #11
abyss commentedRemoved the border for the summary tag.
Comment #12
ravi kant commented@Abyss
The patch is not applying.
Comment #13
abyss commentedVery strange. I double-checked the patch and everything seems to be working correctly.
@ravi kant could you tell us what you used to apply the patch?
Comment #14
ravi kant commented@abyss
Copied patch in theme root and apply patch from theme root in terminal using following command.
git apply patch_file.patchComment #15
abyss commented@ravi kant what version of the theme do you use? 3.0.x-dev?
Because styles are a very delicate thing, and a patch that may apply to one version will not apply to another.
Comment #16
ravi kant commented@Abyss
The version is Bootstrap5 3.0.8.
Comment #17
boddy commentedthe patch was applied on the 3.0.x-dev and 3.0.8
RTBS
Comment #18
bobi-mel commentedThe patch was successfully applied on the 3.0.x-dev
Comment #19
jannakha commentedthis issue is not fixed, see screenshot:
Comment #20
jannakha commentedPatch is in MR
Closed:

Open:

Comment #22
vladimirausThank you for MR! 🍰
Looks great!
Comment #23
jannakha commentedok! here's a proper solution I think!
- as per #5 by @Abyss - yes, you're correct the template needs to be updated
- I have started moving to CSS variables so we can have good things (like dark mode) and actually implementing things the Bootstrap5 way (now that they're moving to CSS variables too)
checkout MR49 - https://git.drupalcode.org/project/bootstrap5/-/merge_requests/49/diffs
HTML component now looks like Bootstrap accordion:
this also will solve issue:
https://www.drupal.org/project/bootstrap5/issues/3380986
Comment #24
vladimirausLooks good! 🧁
Comment #26
vladimirausThank you! Committed! 🍻
Comment #29
vladimirausReverting. More work needed.
See #3449719: Tabbed fieldgroups broken after update 3.0.11 => 3.0.12.
Comment #33
n-i commentedComment #34
jannakha commentedstill an issue in v4
Comment #35
jannakha commentedComment #42
jannakha commentedmoved MR to v4
accordion styles apply cleanly to details
thanks @Abyss 🇺🇦
Comment #43
jannakha commentedComment #45
jannakha commentedmerged to dev
thanks for your contribution
Comment #48
stefan.kornThis changes breaks Drupal core's "vertical tabs" element: https://www.drupal.org/docs/develop/user-interface-standards/vertical-tabs
For example: Edit a node in Bootstrap5 theme, and see the difference between Bootstrap 4.0.7 and 4.0.8.
The "vertical tabs" element is relying somehow on a direct details descendent in its js:
$this.find('> details')At this moment I see no easy fix for this, despite reverting this change.
I am also not exactly sure, whether this change really aligns with Bootstrap.
The details element is a special HTML element: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/det...
From my understanding this is providing a collapsible element directly via the Browser, no need for a framework or something like that.
Bootstrap itself has no reference to the details element as far as I can see. Accordion is an own component, that goes beyond what a simple details element would provide.
In that sense I would not see the necessity to wrap a details element inside a Bootstrap accordion like it is done with this change. Imho the details element could stay like it is and if someone needs/wants an accordion, they should just render a bootstrap accordion.
If one really want to style details like accordion, maybe one could choose just to apply styling like accordion to details, but not adding the Bootstrap accordion functionality on top of a details element.
Comment #49
jannakha commentedthere's an temporary patch for that here - https://www.drupal.org/project/bootstrap5/issues/3574890
semantically details should not be used on these types of elements: ref
proper solution will be implementing vertical tabs like Claro does in Bootstrap 5 style issue #3576867