
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
tailwindcss-overload
Advanced tools
yarn add tailwindcss-overload
You have a component with some baked in TailwindCSS classes:
export const Paragraph = ({ children, className = "", ...rest }) => (
<p {...rest} className={`text-gray-800 font-sans mb-6 ${className}`}>
{children}
</p>
);
All is good. Until in one scenario you just want the margin-bottom
to be different than the default 6
:
<Paragraph className="mb-2">...</Paragarph>
Unfortunately whether or not this works is up to the whims of the "Cascading" in CSS.
No more!
Rewrite the component to use the withTailwindOverload
higher order component.
import { withTailwindOverload } from "tailwindcss-overload";
const Paragraph = ({ children, ...rest }) => {
return <p {...rest}>{children}</p>;
};
Paragraph.defaultClassName = "text-gray-800 font-sans mb-6";
export default Paragraph;
Now when <Paragraph className="mb-2">...</Paragraph>
is rendered the default mb
is removed and the overloaded utility works regardless of "Cascading".
<p class="text-gray-800 font-sans mb-2">...</p>
Issues, PRs and ideas welcome.
Need to add more unit tests that cover large class strings, such as an extremely responsive component. For now I think most of the value comes out of overloading defaults of simple components like margin or color on Typography, widths or max-widths on Containers.. but we'll see.
FAQs
tailwindcss-overload
The npm package tailwindcss-overload receives a total of 3 weekly downloads. As such, tailwindcss-overload popularity was classified as not popular.
We found that tailwindcss-overload 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
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.