
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
bootstrap-dark-theme
Advanced tools
Adds a Bootstrap 5 light/dark theme toggle button in the navbar using Bootstrap color mode
Install via npm:
npm install bootstrap-dark-theme@1
Use locally:
<script src="./node_modules/bootstrap-dark-theme/dist/dark-theme.js"></script>
Use via CDN:
<script src="https://cdn.jsdelivr.net/npm/bootstrap-dark-theme@1"></script>
Add a <div class="bootstrap-dark-theme"></div> inside your navbar. The dark theme toggle replaces it.
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<div class="bootstrap-dark-theme"></div>
</div>
</nav>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-dark-theme@1/dist/dark-theme.js" type="module"></script>
You can replace <div class="bootstrap-theme"></div> with your toggle. For example:
<div class="position-relative" role="group" aria-label="Toggle dark mode" title="Toggle Dark Mode">
<button class="dark-theme-toggle btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Open navigation menu">
<i class="bi bi-circle-half"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li><button class="dropdown-item" data-bs-theme-value="light"><i class="me-2 bi sun-fill"></i> Light</button></li>
<li><button class="dropdown-item" data-bs-theme-value="dark"><i class="me-2 bi bi-moon-stars-fill"> Dark</button></li>
<li><button class="dropdown-item" data-bs-theme-value="auto"><i class="me-2 bi bi-circle-half"> Auto</button></li>
</ul>
</div>
Make sure you have:
dark-theme-toggle that serves as the main toggle buttondata-bs-theme-value with values:
light: Forces the light theme regardless of system preferencedark: Forces the dark theme regardless of system preferenceauto: Uses the system preference (light or dark) based on the user's OS settingsauto.How it works:
data-bs-theme-value attributeauto if invalid)data-bs-theme attribute on the root elementgit clone https://github.com/sanand0/bootstrap-dark-theme.git
cd bootstrap-dark-theme
npm install
npm run lint && npm run build && npm test
npm publish
git commit . -m"$COMMIT_MSG"; git tag $VERSION; git push --follow-tags
https://cdn.jsdelivr.net/npm/bootstrap-dark-theme@1<div class="bootstrap-theme"></div>FAQs
Bootstrap 5 dark theme toggle button
We found that bootstrap-dark-theme demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.