
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A flexible, lightweight theming system for web applications with built-in dark mode support.
npm install flex-theme
# or
yarn add flex-theme
# or
pnpm add flex-theme
import { getTheme, setTheme, toggleTheme } from 'flex-theme';
// Get the current theme ('light', 'dark', or 'system')
const currentTheme = getTheme();
// Set the theme
setTheme('dark');
// Toggle between light and dark
toggleTheme();
// Listen for theme changes
import { onThemeChange } from 'flex-theme';
// Register a listener
const unsubscribe = onThemeChange((theme) => {
console.log(`Theme changed to: ${theme}`);
});
// Later, unsubscribe when no longer needed
unsubscribe();
import { useFlexTheme } from 'flex-theme';
function ThemeToggle() {
const { theme, toggleTheme } = useFlexTheme();
return (
<button onClick={toggleTheme}>
Current theme: {theme}
</button>
);
}
| Function | Description |
|---|---|
getTheme() | Returns the current theme ('light', 'dark', or 'system') |
setTheme(theme) | Sets the theme to the specified value |
toggleTheme() | Toggles between light and dark themes |
getResolvedTheme() | Returns the resolved theme ('light' or 'dark'), taking into account system preferences when set to 'system' |
onThemeChange(callback) | Registers a callback to be called when the theme changes |
offThemeChange(callback) | Removes a previously registered theme change callback |
| Hook | Description |
|---|---|
useFlexTheme() | Returns an object with theme state and methods to control it |
useSystemTheme() | Returns the system's preferred theme ('light' or 'dark') |
useThemeWithStorage() | Theme hook with localStorage persistence |
FlexTheme works in all modern browsers (Chrome, Firefox, Safari, Edge).
MIT © [Teck]
FAQs
A flexible theming system for web applications
We found that flex-theme demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.