
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.
@hadeeb/css.macro
Advanced tools
A tiny CSS in JS solution for simple use cases, built with babel-plugin-macros and PostCSS.
<span
className={css`
color: #222222;
`}
>
Content
</span>
autoprefixer.postcss-nested.~200 Bytes).yarn add @hadeeb/css.macro
// OR
npm install @hadeeb/css.macro
You'll also need to install and configure
babel-plugin-macros if you haven't already.
import { css } from "@hadeeb/css.macro";
<button
className={css`
font-weight: 500;
`}
>
Content
</button>;
import { styled } from "@hadeeb/css.macro";
const StyledDiv = styled.div`
font-weight: 500;
span {
font-size: 12px;
}
`;
// OR
const StyledDiv = styled("div")`
font-weight: 500;
span {
font-size: 12px;
}
`;
styled can also wrap any component which accepts a className prop
import { styled } from "@hadeeb/css.macro";
import { Link } from "react-router-dom";
const StyledLink = styled(Link)`
color: blue;
&:hover {
color: red;
}
`;
import { injectGlobal } from "@hadeeb/css.macro";
injectGlobal`
body {
margin: 0;
}
`;
Styles can also be declared as objects
Note: objects should be declared inline.
import { css, styled, injectGlobal } from "@hadeeb/css.macro";
<span className={css({ fontSize: 14 })}>Content</span>;
const StyledDiv = styled.div({
fontWeight: 500,
".someClass": {
fontSize: 12
}
});
injectGlobal({
".root": {
height: "100vh"
}
});
After rendering the components extract the CSS and add it to the DOM
import { extractCSS, styleID } from "@hadeeb/css.macro/server";
const styleTag = `<style id="${styleID}">${extractCSS()}</style>`;
FAQs
A tiny CSS in JS solution for simple use cases
We found that @hadeeb/css.macro 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
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.