
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
fancy-theme-toggle
Advanced tools
A fancy theme toggle web component
As seen on https://www.instagram.com/reel/C4bA-9cC0kZ/

import { FancyThemeToggle } "fancy-theme-toggle";
customElements.define("my-theme-toggle", FancyThemeToggle);
<!-- Unchecked (light mode) -->
<fancy-theme-toggle></fancy-theme-toggle>
<!-- Checked (dark mode) -->
<fancy-theme-toggle checked></fancy-theme-toggle>
<fancy-theme-toggle></fancy-theme-toggle>
<script>
const toggle = document.querySelector("fancy-theme-toggle");
toggle.addEventListener("change", (event) => {
const isDark = event.target.checked;
});
</script>
<fancy-theme-toggle></fancy-theme-toggle>
<script>
const toggle = document.querySelector("fancy-theme-toggle");
toggle.setAttribute("checked", ""); // dark
toggle.removeAttribute("checked"); // light
toggle.click(); // toggle between light and dark
</script>
The animation duration can be customised by overwriting the --ftt-duration custom property.
fancy-theme-toggle {
--ftt-duration: 600ms;
}
The toggle is 32x80 pixels by default.
You can customize this by overwriting the --ftt-height custom property. The width of the toggle will update accordingly.
fancy-theme-toggle {
--ftt-height: 64px;
}
The fancy-theme-toggle element uses display: inline-grid.
If you want it to be block level, you can use display: grid instead.
fancy-theme-toggle {
display: grid;
}
FAQs
A fancy theme toggle web component
We found that fancy-theme-toggle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.