Skip to content

v5.1.0: bundle Bootstrap 5.3.7 SCSS; Bootstrap.load(loadCss: false) - #14

Merged
gmpassos merged 2 commits into
masterfrom
feat/bootstrap-scss-5.1.0
Oct 8, 2026
Merged

gmpassos merged 2 commits into
masterfrom
feat/bootstrap-scss-5.1.0

Conversation

@gmpassos

@gmpassos gmpassos commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lets apps compile their own themed Bootstrap CSS from the same Bootstrap version as the bundled CSS/JS, without loading Bootstrap's CSS twice.

  • Bundled SCSS: lib/bootstrap-5/scss — the official Bootstrap 5.3.7 SCSS, unmodified from the bootstrap 5.3.7 npm package (tarball integrity verified against the registry; its dist CSS/JS are byte-identical to the already bundled files).
    $primary: #a2a2a2;
    @import "package:bones_ui_bootstrap/bootstrap-5/scss/bootstrap";
    Only the major version is in the SCSS path, so Bootstrap 5.x updates don't change app imports. The CSS and JS stay in lib/bootstrap-<version>: the browser loads them, and the versioned path busts its cache on updates.
  • Bootstrap.load({bool loadCss = true}): with false only the Bootstrap JS is loaded. Only the first call loads (later options are ignored, as before).
  • New Bootstrap.PATH_SCSS and Bootstrap.isCssLoaded.
  • README: new "Custom Bootstrap theme (SCSS)" section. CHANGELOG: 5.1.0.
  • New dev_dependencies: sass, package_config (tests only).

Tests

  • bones_ui_bootstrap_scss_vm_test.dart: compiles the SCSS through its package: URL with the default variables and with a custom theme; importing only functions/variables/maps/mixins/utilities outputs no CSS; the SCSS banner matches Bootstrap.VERSION; the README import path is valid.
  • bones_ui_bootstrap_consistency_vm_test.dart: the stale-directory check allows bootstrap-<major> next to bootstrap-<version>.
  • bones_ui_bootstrap_no_css_test.dart: load(loadCss: false) loads the JS, adds no Bootstrap <link>, applies no Bootstrap styles; a later load() keeps the first options.
  • dart test -p vm: 19 passed. dart test -p chrome: 64 passed. dart analyze, dependency_validator: clean.

Note: Bootstrap 5.3 SCSS uses @import and global built-in functions, so Dart Sass prints deprecation warnings when compiling it.

🤖 Generated with Claude Code

gmpassos and others added 2 commits October 7, 2026 21:02
- Bundle the official Bootstrap 5.3.7 SCSS sources (unmodified, from the
  bootstrap 5.3.7 npm package) at lib/bootstrap-5.3.7/scss, so apps can
  compile their own Bootstrap theme from the same version as the bundled
  CSS/JS.
- Bootstrap.load: new loadCss parameter; with false only the JS is loaded.
- New Bootstrap.PATH_SCSS and Bootstrap.isCssLoaded.
- Tests: compile the SCSS through its package: URL (default and custom
  theme); load(loadCss: false) in the browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apps import package:bones_ui_bootstrap/bootstrap-5/scss/bootstrap, so
Bootstrap 5.x updates don't change their SCSS imports. The CSS and JS stay
in lib/bootstrap-<version>, whose path busts the browser cache on updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gmpassos
gmpassos merged commit 36b0687 into master Oct 8, 2026
1 check passed
@gmpassos
gmpassos deleted the feat/bootstrap-scss-5.1.0 branch October 8, 2026 00:08
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