Skip to content

Design system 2/4: Load the design system stylesheet alongside Bootstrap - #5766

Draft
awwaiid wants to merge 1 commit into
design-system/01-tailwind-foundationfrom
design-system/02-load-alongside-bootstrap
Draft

awwaiid wants to merge 1 commit into
design-system/01-tailwind-foundationfrom
design-system/02-load-alongside-bootstrap

Conversation

@awwaiid

@awwaiid awwaiid commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #5764. Stacked draft PR 2 of 4, based on PR 1. Plan: docs/design-system-slicing-plan.md on the design branch

Stack (review and merge in order; each PR shows only its own diff):

  1. Design system 1/4: Add the Tailwind toolchain and tokens (not yet loaded) #5765 Toolchain and tokens (no visible change)
  2. Design system 2/4: Load the design system stylesheet alongside Bootstrap #5766 Load alongside Bootstrap (no visible change) 👈 this PR
  3. Design system 3/4: Paint the existing UI with the design system's colour tokens #5767 Colour tokens on the existing UI
  4. Design system 4/4: Switch the typeface to Figtree #5768 Figtree typeface + date-picker spec fix

Description

Links the design system stylesheet from the three live layouts (bank app, partner portal, sign-in), after every other stylesheet. No page changes. I screenshotted 25 pages as four roles (signed out, bank user, super admin, partner). 24 are pixel-identical before and after. The 25th is /admin/dashboard, which shows live data and also differs between two runs of the same build.

The design branch never put both stylesheets on one page. Each migrated area moved to a new Tailwind-only layout with its own navigation. Loading both is what lets later PRs bring the design system in one concept at a time (tokens, buttons, tables, forms…) without moving buttons or changing navigation. What makes it safe:

  • No Preflight (PR 1). Bootstrap's Reboot keeps owning element defaults.
  • No class collisions. If Tailwind scanned today's views as they are, it would emit about 90 utilities that Bootstrap/AdminLTE also define, with different meanings. For example, mb-3 is 0.75rem in Tailwind and 1rem in Bootstrap, and Tailwind's collapse would hide every open Bootstrap collapsible. A new spec fails if any class is defined by both stylesheets. I checked that it catches a planted mb-3 and collapse.
  • Cascade layers. Tailwind's output is layered and Bootstrap is not, so Bootstrap wins any property both set.

Fixes a deploy-breaker. Outside development, sassc-rails defaults css_compressor to :sass. libsass can't parse Tailwind v4 output, so a production assets:precompile would fail. TailwindSafeCssCompressor skips the Tailwind build, which the CLI already minifies, and hands everything else to the same Sass compressor. The compiled Bootstrap application.css is byte-identical to before (same SHA-256), and a production precompile succeeds.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • bundle exec rspec spec/assets/design_system_build_spec.rb
  • RAILS_ENV=production bundle exec rails assets:precompile
  • A Playwright pixel diff of 25 pages against main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UCzWYw6Gq5YdmU4MaiGnQa

Second slice of #5764. The design system stylesheet is now linked from the
three live layouts (bank app, partner portal, sign-in/devise), after every
other stylesheet. No page changes: 24 of 25 screenshotted pages across
signed-out, bank, super admin and partner users are pixel-identical before
and after. The 25th, /admin/dashboard, also differs between two runs of
the same build because it shows live data.

The design branch never put both on one page: each migrated area moved to a
new Tailwind-only layout with its own navigation. Loading both is what lets
later slices bring the design system in one concept at a time (tokens,
buttons, tables, forms...) without moving buttons or changing navigation.
The rules that make it safe:

- No Preflight (slice 1). Bootstrap's Reboot keeps owning element defaults.
- No class collisions. Scanning today's views as-is would emit about 90
  utilities that Bootstrap/AdminLTE also define, with different meanings
  (`mb-3` is 0.75rem vs 1rem; Tailwind's `collapse` is visibility:
  collapse and would hide every open Bootstrap collapsible).
  design_system_build_spec now fails on any class both stylesheets
  define; checked against a planted `mb-3` and `collapse`.
- Tailwind's output is in cascade layers and Bootstrap is unlayered, so
  any property both set goes to Bootstrap.

Also fixes a deploy-breaker the design branch only half-diagnosed: outside
development, sassc-rails defaults css_compressor to :sass (production.rb
only comments the line out), and libsass raises on Tailwind v4 output, so
`assets:precompile` would fail. TailwindSafeCssCompressor skips the
Tailwind build, which the CLI already minifies, and hands everything else
to the same Sass compressor. The compiled Bootstrap application.css is
byte-identical to before (same SHA-256 in test), and a production
precompile succeeds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCzWYw6Gq5YdmU4MaiGnQa

This branch has not been deployed

No deployments
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.

1 participant