
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.
nano-theme
Advanced tools
A light and opinionated distribution of [`nano-css`](https://github.com/streamich/nano-css). It ships all necessary dynamic tooling for most CSS-in-JS use cases, while in very lightweight packaging. `nano-theme` also ships predefined light and dark themes
A light and opinionated distribution of nano-css.
It ships all necessary dynamic tooling for most CSS-in-JS use cases, while in very
lightweight packaging. nano-theme also ships predefined light and dark themes.
As well as colorful color palette, predefined breakpoints and global CSS reset.
npm i nano-theme
First you might want to reset the global CSS.
import 'nano-theme/lib/global-reset';
Now use the rule utility to create CSS classes.
import {rule} from 'nano-theme';
const className = rule({
color: 'red',
fontSize: 16,
'@media screen and (min-width: 768px)': {
color: 'blue',
},
});
You can use shorthand "atoms":
import {rule} from 'nano-theme';
const className = rule({
col: 'red',
fz: 16,
'@media screen and (min-width: 768px)': {
col: 'blue',
},
});
Create CSS animations.
import {keyframes} from 'nano-theme';
const animationName = keyframes({
from: {
opacity: 0,
},
to: {
opacity: 1,
},
});
Import various theming helpers.
import {theme, font, colors, b1, b2, b3, b4} from 'nano-theme';
React integration is also provided:
import {Provider, GlobalCss, useTheme, useRule, makeRule} from 'nano-theme';
The Provider components sets the theme for the entire application. And GlobalCss
component applies some global CSS, based on the current theme.
<Provider theme={'light'}>
<GlobalCss />
<MyApp />
<Provider/>
The useTheme hook returns the current theme.
const theme = useTheme();
The useRule hook and makeRule function are used to dynamically create CSS classes at render-time.
useRule example:
const MyComponent = () => {
const className = useRule({
col: 'red',
fz: 16,
'@media screen and (min-width: 768px)': {
col: 'blue',
},
});
return <div className={className}>Hello</div>;
};
makeRule example:
const useClassName = makeRule({
color: 'red',
fontSize: 16,
'@media screen and (min-width: 768px)': {
color: 'blue',
},
});
const MyComponent = () => {
const className = useClassName();
return <div className={className}>Hello</div>;
};
FAQs
A light and opinionated distribution of [`nano-css`](https://github.com/streamich/nano-css). It ships all necessary dynamic tooling for most CSS-in-JS use cases, while in very lightweight packaging. `nano-theme` also ships predefined light and dark themes
The npm package nano-theme receives a total of 300 weekly downloads. As such, nano-theme popularity was classified as not popular.
We found that nano-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
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.