Skip to content

Chore/bootstrap 5 - #4813

Merged
Br3nda merged 39 commits into
devfrom
chore/bootstrap-5
Sep 21, 2026
Merged

Br3nda merged 39 commits into
devfrom
chore/bootstrap-5

Conversation

@Br3nda

@Br3nda Br3nda commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

What changed

The site's CSS now comes from Bootstrap 5.3.8. It used to come from material-sass, which is Bootstrap 4 with a Material skin.

  • Removed the material-sass gem and the material script.
  • Updated the bootstrap gem from 5.3.2 to 5.3.8. The gem also supplies the CSS now.
  • Rewrote _variables.scss for Bootstrap 5. It keeps the site colours and the lg and xl breakpoints.
  • Kept the old text size, line height, heading sizes and unstyled links.
  • Fixed the navbar logo and search box, which broke under Bootstrap 5.
  • Buttons look as before: raised by a shadow, no border, uppercase, 2px corners. Link buttons stay plain. A bare .btn is drawn raised with dark text, because it would otherwise look like a link.
  • Kept three even columns on the home page.
  • Matched the breadcrumb padding and divider.
  • Made cards white and raised again, with the old shadow.
  • Lightened the header menu links and darkened the breadcrumb links. Both were under the 4.5:1 contrast minimum.
  • Crop chips now have a soft green fill, border and dark green text, using Bootstrap's subtle success colours. They were solid brown-grey with white text.

Class names

Renamed Bootstrap 3 and 4 classes in the views, helpers and scripts.

  • text-left, text-right, float-left, float-right
  • ml-*, mr-*, pl-*, pr-*
  • badge-info and the other badge colours, badge-pill
  • font-weight-*, sr-only, dropdown-menu-right
  • form-group, btn-block, btn-xs, btn-default
  • col-xs-*, col-md-offset-*, row-fluid

Other markup changes:

  • The Bootstrap 3 style forms now use a .row per field, col-form-label and form-text.
  • .close buttons are now .btn-close.
  • alert-dismissable is now alert-dismissible.
  • form-inline, embed-responsive, input-group-prepend and media are replaced.
  • The garden card components from Quick planting addition form #4808 use the new names too.

Other fixes

  • Removed a duplicate Delete link that sat in the garden page body.
  • The crop wrangler spec now stubs GBIF. It raced a live request before.
  • Body text is near-black again. Links have no underline, and axe needs the contrast.
  • Fixed progress bars. Old Bootstrap 3 variables in _variables.scss made them 52px tall with a white track. They are now a thin strip on a neutral grey track.
  • Progress bars change colour with the planting's state: blue while growing, green while harvesting, amber when late, red when very late, grey when finished. Planting#progress_state decides, and the garden cards, planting progress and timeline bars all use it.
  • Fixed the like button. Bare badges are white in Bootstrap 5, so its heart and count were white on light grey.
  • Seed cards no longer draw an empty body and footer. Bootstrap 5 pads them into white bars.

What looks different

Progress bars are now coloured by state, and crop chips are light green. Everything else was matched to the old look and measurements.

Testing

  • Non-browser specs pass.
  • Every feature directory passes.
  • The garden, serializer and request specs were run again after merging dev.
  • Compared 15 pages before and after with screenshots.

Not changed

About 27 class names in the views have no CSS. They had none before either. The static error pages are untouched.

Br3nda and others added 16 commits September 20, 2026 18:00
The CSS came from the material-sass gem, a Bootstrap 4 based Material Design
skin, while the JavaScript already came from the bootstrap gem (Bootstrap 5).
Import the bootstrap gem's SCSS instead and drop material-sass and its
'material' script.

Bootstrap 5 reads its settings from variables defined before it is imported,
so _variables.scss now sets the theme colours (primary/success green,
secondary blue, and so on), body colours, font and the site's own breakpoints
(lg 1200px, xl 1800px) in Bootstrap's terms, in place of the Material colour
maps. media-breakpoint-down(xs) is media-breakpoint-down(sm) in Bootstrap 5.

Class names from Bootstrap 3 and 4 that no longer exist are renamed in the
commits that follow.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
text-left/right -> text-start/end, float-left/right -> float-start/end,
ml-/mr-/pl-/pr- -> ms-/me-/ps-/pe-, border-left/right -> border-start/end,
dropdown-menu-left/right -> dropdown-menu-start/end, font-weight-* -> fw-*,
font-italic -> fst-italic and sr-only -> visually-hidden. Bootstrap 5 dropped
text-justify, so the site keeps a one-line rule for it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
badge-info/success/... -> text-bg-info/success/..., which set the background
and a readable text colour together, and badge-pill -> rounded-pill. The site's
own badge-late, badge-harvest and similar hooks are unchanged.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
col-xs-N -> col-N, col-md-offset-N -> offset-md-N, row-fluid -> row,
btn-block -> w-100, btn-xs -> btn-sm, form-group -> mb-3 (Bootstrap 5 dropped
form-group), and btn-default (Bootstrap 3) -> btn-outline-secondary. The three
helpers that combined btn-default with btn-secondary keep just btn-secondary.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
.close with a times character -> .btn-close (which draws its own cross), with an
aria-label on each. The alert helper said alert-dismissable, Bootstrap 3's
spelling; Bootstrap 5 needs alert-dismissible for the close button's spacing.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The label-beside-input forms (label col-md-2, input col-md-8) relied on
form-horizontal and form-group acting as a row. Each field wrapper is now a real
.row.mb-3, labels are col-form-label, help text is form-text, and the leftover
form-horizontal and form-actions classes, which do nothing in Bootstrap 5, are
dropped.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ents

form-inline -> flex utilities, embed-responsive -> ratio ratio-16x9,
input-group-prepend wrapper removed (Bootstrap 5 puts the addon directly in
the group), and media/media-body -> d-flex/flex-grow-1.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bootstrap 5 differs from the old Material skin in a few defaults that change how
every page looks: 1rem body text (the site uses 0.875rem), a 1.5 line height
(1.428572), underlined links, and much larger display-* headings (the home page
heading was 56px, not 34px). Set them back through Bootstrap's variables.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The brand image was unbounded (the old skin capped the brand at 2.25rem) and the
search input collapsed to nothing inside its shrink-to-fit parent. Restore the
navbar's minimum height and padding, cap the brand, and give the search group a
minimum width. A .btn with no colour variant is plain text in Bootstrap 5 and
read as a link; give it the btn-outline-secondary look.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The planting, harvest and activity columns were .col-xl-4.col. Bootstrap 4 wrapped
the next row after three even columns at every width below the site's xl
breakpoint; Bootstrap 5's .col let the seeds column squeeze onto the same row.
Say what was meant: full width on phones, thirds from md up.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
A .dropdown-divider and a dropdown-item Delete link sat in the page body, outside
any dropdown, duplicating the Delete in the Actions menu. With the menu open the
page has two visible Delete links, and the 'Delete garden' spec, which clicks
'Actions' and then 'Delete', finds both. The Actions menu already has the
garden's Delete.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Links are not underlined, so axe's link-in-text-block rule needs enough contrast
between a link and the text around it. The old skin's body text was near black
(rgba(0, 0, 0, 0.87)); the brown I had used gave 2.28:1 against the link green,
below the 3:1 minimum, and failed two accessibility specs.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Typing a scientific name makes the page ask GBIF for suggestions after
jQuery UI's 300ms delay. Whether that request lands before Save navigates away
is a race the test only usually won, and when it lost, VCR blocked the real
request and failed the spec. Answer the suggestion with a double instead.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@Br3nda
Br3nda marked this pull request as draft September 20, 2026 08:21
Br3nda and others added 10 commits September 20, 2026 20:26
The cards from #4808 still used Bootstrap 4 names: .close with a times sign
(now .btn-close), sr-only (now visually-hidden), badge-info (now text-bg-info),
and dropdown-menu-right next to dropdown-menu-end (only -end is needed).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bootstrap 5's cards have a thin border, a grey header and a transparent body, so
the page background showed through. Set the card variables to white, no border,
a 2px radius and the old three-layer shadow, and keep the line under the header.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bootstrap's dark navbar draws menu links at 55% white, which on the brown navbar
is 4.47:1, just under the 4.5:1 minimum. Use 85% white (white on hover). The
breadcrumb links were grey in the old skin and are now the link green, 4.12:1 on
the beige page; make them a darker grey again.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
_variables.scss still set $progress-height: 5em, $progress-bar-color and
$progress-bg: white, Bootstrap 3 variables the old skin ignored. Bootstrap 5
reads them, which made every progress bar 52px tall with an invisible white
track. Set the height to 0.875rem (as the old bar was), the track to a lighter
green and the bar to the site green, and drop the border-bottom trick that drew
the old bar.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The chips were solid brown-grey pills with white text, so a row of crops read as a
row of dark blobs, and they competed with the blue status badges. Use Bootstrap
5.3's subtle success colours instead: a light green fill and border with dark
green text.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bootstrap 5 makes the text of a .badge white; Bootstrap 4 left it alone. The like
button's heart and count sit in a bare badge on a pale button, so they were white
on light grey. Set $badge-color to inherit, as before.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The card always rendered a .card-body and a .card-footer. A seed with no details
left them empty, and Bootstrap 5 pads them into white bars under the photo. Draw
each only when it has something in it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bootstrap 5 buttons are flat with a border. Draw them as the old skin did:
no border, a Material shadow that deepens while pressed, 2px corners,
medium weight and uppercase. Link buttons stay plain. A bare .btn is drawn
raised with dark text instead of borrowing the outline style.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Blue while growing, green while harvesting, amber when late, red when very
late, grey when finished. The track is now neutral grey so every colour
reads against it. Planting#progress_state decides, and the garden cards,
planting progress and timeline bars use it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@Br3nda
Br3nda marked this pull request as ready for review September 20, 2026 09:40
@Br3nda
Br3nda requested a review from CloCkWeRX September 20, 2026 10:50
Br3nda and others added 2 commits September 21, 2026 17:40
--bs-secondary is the site's dark blue here, so finished plantings had a
blue bar rather than the grey the progress colours call for.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
In Bootstrap 5 the close button has an auto left margin, so before the
title it sat beside it instead of at the right edge.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@CloCkWeRX

Copy link
Copy Markdown
Collaborator

Pity staging has been busted for a bit and we don't have percy / a screenshot comparison tool in place these days.
I'll give this a whirl in codespaces/on mobile

@CloCkWeRX

Copy link
Copy Markdown
Collaborator

Might cherry pick some of the other fixes (487a7c3 for example) ahead of this

@CloCkWeRX
CloCkWeRX added this pull request to stack #4821 September 21, 2026 08:08
@CloCkWeRX
CloCkWeRX removed this pull request from stack #4821 September 21, 2026 08:15
@Br3nda

Br3nda commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Hoping to get the UI PR in, cos it'll make it easier to enter my spring garden plantings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Two crop approval views drop the Bootstrap .badge base class, so those statuses lose their badge styling.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)
Resolved since last review (4)

Comment thread app/views/crops/_info.haml Outdated
Comment thread app/views/crops/_tiny.html.haml Outdated
@CloCkWeRX

CloCkWeRX commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

UI comparison (left this branch, right prod)

Homepage > Plantings
Backgrounds no longer card-ish.
image

Crops > Show
Link colour, styling
image

Photos > View On Flickr > Text color

image

Homepage > Seeds to trade > Badge color text
(Is it also possible to make the li smaller text?)

image

Sign In, "Remember me" checkbox
image

Sign in menu (smaller view) - chevrons
image

@CloCkWeRX

Copy link
Copy Markdown
Collaborator

I reckon if you tweak the crops show (sign in or sign up) one, the rest.... we can deal with in later PRs

Br3nda and others added 9 commits September 21, 2026 20:48
%badge.text-bg-warning was a <badge> element with a colour and no Bootstrap
badge styling, so it rendered as plain text.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
It was a solid green active list item holding a green link. Use the light
list item, as the other sign in bars are.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bootstrap 5 picked black text for the old #2196f3 on text-bg-info badges
and btn-info buttons, where the site had white. #1976d2 gets white text at
4.6:1, which also passes.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The border was too faint to see, and Bootstrap 5 floated the checkbox to the
left edge of centred forms, away from its label.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
list-group-item outside a .list-group has no background or border in
Bootstrap 5.3, as those come from variables set on .list-group. Wrap the
homepage lists and the planting page neighbours in one, white with a light
shadow.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bootstrap 5's chevron is a border triangle, so width: 100% stretched it into
a bar. The grid for icon, label and chevron also applied to the sign in and
sign up buttons, squeezing their labels into the icon column.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Three across in a half-width column left them narrow enough to wrap
mid-word.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@Br3nda

Br3nda commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

pushing some fixes

@CloCkWeRX

Copy link
Copy Markdown
Collaborator

Looks a fair bit nicer now. There's still some areas where it's dropped a border/card style, but... meh, later!
image

@Br3nda
Br3nda merged commit 414701d into dev Sep 21, 2026
17 checks passed
@Br3nda
Br3nda deleted the chore/bootstrap-5 branch September 21, 2026 09:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The migration still has state badge styling, mobile navbar sizing, and Bootstrap form-control regressions.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 4 Medium severity

Open (4)
Resolved since last review (2)


// Bootstrap 5's input-group shrinks to nothing inside a shrink-to-fit parent.
.input-group {
min-width: 18rem;
%h5
%strong= link_to harvest.crop_name, harvest_path(slug: harvest.slug)
%span.badge.badge-pill= harvest.plant_part_name
%span.badge.rounded-pill= harvest.plant_part_name
- content_for :title, "Edit Photo"
= form_for(@photo) do |f|
.form-group
.mb-3
- if planting.finish_is_predicatable?
- if planting.super_late?
%span.badge.badge-info.badge-super-late= t('.super_late')
%span.badge.text-bg-info.badge-super-late= t('.super_late')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants