bootstrap-ui: Bootstrap 5 Support - Tasks and problems
It seems that overall, supporting BS5 will not require too drastic changes, there’s a few things broken, but it’s absolutely nothing like the BS3 to BS4 transition, most of the generated HTML seems compatible as-is.
Here’s a most likely incomplete list of problems/tasks that I’ve found so far (some of them might also be problems in the current version, which can be backported later on).
General
- Upgrade dependencies (drop jQuery, upgrade Popper to 2.x).
- Screenreader-only content is not being hidden (
sr-onlyhas been renamed tovisually-hidden). - Update custom CSS according to browser support changes (prefixes no longer required, etc).
- Update documentation.
Form Helper
- Labels are missing bottom margins (they now require a
form-labelclass). - Controls are missing bottom margins (
.form-grouphas been removed). - Inline multi checkbox groups are not inline aligned (
.form-inlinehas been removed). - Remove custom controls, the “custom” style is now the default.
- File input not rendering correctly (
.form-control-filehas been removed). - Range control labels are vertically misaligned in horizontal forms.
- Select controls should use
form-selectinstead ofform-control. - Input group addons no longer use a wrapper (
.input-group-appendand.input-group-prependhave been removed). - Tooltips do not toggle anymore (
data-togglehas been renamed todata-bs-toggle). - Combined inline controls collapse into each other (
.form-inlinehas been removed). - Checkbox help text sticks to the right side of the label (
.form-textdoes not set block level display anymore). - Use rows and columns for inline forms.
- ~Custom input classes for radio and checkbox controls prevent
is-invalidfrom being added (problem is in core radio widget, it merges options using+).~ Not worth the hassle right now. - Check if and where
ptclasses are still needed… they are needed for range, radio and multi checkbox. - ~Remove no longer available
form-groupandform-inline?~ Keeping them should do no harm, in fact, they make it easier for people to apply their own styles. - ~Remove seemingly no longer needed
d-blockclasses for labels?~ Actually still required. - Remove backwards compatibility tests?
- Add support for help text association using
aria-describedby? - Add support for multiple ID reference lists for
aria-describedby, and include references to error messages additionally to help text. - Add support for floating labels? They are a bit tricky, in horizontal forms, labels would need to be grouped with the control in the right column, and for inline forms the label would need to be not hidden.
- Add support for multiple input group text addons?
- Add color control?
- ~Add datalist support?~ Not yet.
- Add switch support?
- ~Add support for toggles?~ Nah…
Html Helper
- Badges have no background.
- Remove deprecated
label()method.
Flash Helper
- Flash messages cannot be dismissed (
data-dismisshas been renamed todata-bs-dismiss). - Flash message close icon is not rendering correctly.
- Add support for (custom) icons via options?
Icons
- Drop Font Awesome, use and include Bootstrap Icons by default instead?
Bake templates / Template styles
-
dashboard.ctpnavbar is rendering the brand incorrectly. -
dashboard.ctpsidebar layout is broken. -
view.ctprenders text column types incorrectly. -
login.ctpis missing margins. -
login.ctpshould render Flash messages and form inside of the same container?
I’ve already done/fixed some things, because why not, I was already on it, so I could as well just do it. I’ll push an open PR shortly.
However I’ve only taken care of actual necessities so far, as other problems/tasks require some feedback, specifically the ones that have a question mark. If anyone has any input on this, it would be very much appreciated!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 20 (3 by maintainers)
I’m done for now, my list is complete. I’ll tag an~other~ RC, and if no further major changes are being introduced, I’d personally be fine with a stable release after that.
If anyone has any additional wishes, suggestions, complaints, whatever, please voice them.
I might try to squeeze in a fix for the floating label placeholder “problem” if I can figure something better now, but that would really be the last change then before the stable release 😬
Does this seem good to add a stable release for it? I’ve been using it and haven’t found specific issues.
I’m not sure, I think I’d argue that the icon helper is very different, as the classes here are tied to its main functionality. The classes in the form helper on the other hand are either of “optional”/“decorative”, or workaround nature.
I’m inclined to agree as far as pure styling classes go that are just “a matter of tase”, like
mb-3andg-3, as they just define spacing (which isn’t there anymore by default forform-groupsince BS5).d-blockon the other hand would be an example of something that is very much required, it’s a workaround to make errors and help text show up in situations where Bootstrap’s sibling based selector for those elements unfortunately doesn’t match. And thept-classes, without them the alignment of labels is off, it’s something that’s used in the BS docs examples too, so I’m not sure in which category I’d put them 🤔 And lastly there’sms-0for the error element, this also is alignment related.I’d say the container and inline grid spacing would be something where configuration might be considered reasonable, but I’d like to hear 1 or 2 more opinions on this. Ideally, if such options were added, they would be somewhat, well, not neccesarily “version idependent”, but somewhat “generic” enough to not be directly associated with specific Bootstrap features, if that makes any sense.
In case there will be no objections, I will add support for color and switches, in the hope that this color validation bug will be fixed sometime soon.
I’m not a fan of radio toggle buttons, it feels like a really bad UX to me personally, so I’m probably not gonna bother with them. Datalists, I’m not sure, but given their inconsistent behavior between browsers, I’m not overly intrigued putting work into this right now.