• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

palcarazm / bs-darkmode-toggle / 24042907350
98%
v1: 98%

Build:
Build:
LAST BUILD BRANCH: dependabot/npm_and_yarn/docs/version-updates-8b302c2185
DEFAULT BRANCH: v1
Ran 06 Apr 2026 05:41PM UTC
Jobs 2
Files 14
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Apr 2026 05:40PM UTC coverage: 98.182% (-0.5%) from 98.67%
24042907350

push

github

web-flow
feat: add button layout as alternative to bootstrap-toggle slider (#74)

* feat: add button layout as alternative to bootstrap-toggle slider

Add a new layout option that creates a native Bootstrap 5 button instead
of the bootstrap-toggle slider component. This reduces external
dependencies and bundle size while maintaining full functionality.

Changes:
- Add Layout enum (BUTTON, TOGGLE) to OptionResolver.types
- Add layout property to DarkModeOptions and ResolvedOptions
- Refactor DOMBuilder into AbstractLayout with two implementations:
  - ToggleLayout: preserves original bootstrap-toggle behavior
  - ButtonLayout: creates a native button with Bootstrap 5 classes
- Add DomManager facade to select appropriate layout
- Update DarkModeToggle to use DomManager with onChange handler
- Add layout option to documentation (features and API table)
- Add ButtonLoader to test application for manual testing
- Add comprehensive unit tests for all layout components

Default layout remains "toggle" for backward compatibility.
Invalid layout values fall back to "toggle" gracefully.

Implements #61

* chore: make bootstrap5-toggle an optional peer dependency

Since the new button layout (introduced in #61) does not require the
bootstrap5-toggle library, this dependency is now optional. Users who
only use the button layout no longer need to install it, reducing
unnecessary dependencies and bundle size.

This change maintains backward compatibility for existing users who
rely on the default toggle layout.

Implements #61

* refactor: remove unnecessary non-null assertions from layouts

Remove the non-null assertion operators (!) from ButtonLayout and
ToggleLayout methods. The button and input getters already guarantee
that the elements exist (lazy initialization via nullish coalescing
assignment), making the assertions redundant.

This change resolves SonarQube warning typescript:S4325 (redundant
casts and non-null assertions) and improves code safety without
affectin... (continued)

193 of 198 branches covered (97.47%)

Branch coverage included in aggregate %.

69 of 69 new or added lines in 7 files covered. (100.0%)

3 existing lines in 1 file now uncovered.

239 of 242 relevant lines covered (98.76%)

117.87 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
94.96
-2.54% src/main/ts/DarkModeToggle.ts
Jobs
ID Job ID Ran Files Coverage
1 coverage-report-24.x - 24042907350.1 06 Apr 2026 05:41PM UTC 28
98.41
GitHub Action Run
2 coverage-report-22.x - 24042907350.2 06 Apr 2026 05:41PM UTC 28
98.41
GitHub Action Run
Source Files on build 24042907350
  • Tree
  • List 14
  • Changed 9
  • Source Changed 3
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #24042907350
  • 8239220c on github
  • Prev Build on develop/1.0.0 (#24030079827)
  • Next Build on develop/1.0.0 (#24067846202)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc