
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.
tailwindcss-multiple-classes
Advanced tools
adding new functionality - merged pseudo-classes and pseudo-elements
Defining several classes at once for one variant
One of the proposed syntaxes in X, which is voted for the most
Before:
const Main = () => {
return <main className="flex mm:bg-red,text-green,hover:text-3xl">...</main>;
};
After:
const Main = () => {
return <main className="flex mm:bg-red mm:text-green mm:hover:text-3xl ">...</main>;
};
const main = () => {
return <main className="flex supports-[not(**)]:min-height-[10.1px]:h-10,sm:h-20,md:h-30, lg:h-40,xl:h-50,hover:(pl-4,py-3) pl-3">...</main>;};
After:
const main = () => {
return <main className="flex supports-[not(**)]:min-height-[10.1px]:h-10 supports-[not(**)]:min-height-[10.1px]:sm:h-20 supports-[not(**)]:min-height-[10.1px]:md:h-30 supports-[not(**)]:min-height-[10.1px]:lg:h-40 supports-[not(**)]:min-height-[10.1px]:xl:h-50 supports-[not(**)]:min-height-[10.1px]:hover:pl-4 supports-[not(**)]:min-height-[10.1px]:hover:py-3 pl-3">...</main>;};
IMPORTANT: You need to connect the PostCSS plugin
Before:
.class {
@apply mm:bg-red,text-green;
}
After:
.class {
@apply mm:bg-red mm:text-green;
}
SPACE for separator will result in an error. This is done for several reasons:tailwindcss, talked about how incompatible this syntax is with different templates (like unoCSS)npm install --save-dev tailwindcss-multiple-classes
Creating a function and exporting it:
// transformMultipleClasses.js
import createTransform from 'tailwindcss-multiple-classes';
const transformMultipleClasses = createTransform({ separator: ',', opBracket: '(', clBracket: ')' });
export default transformMultipleClasses;
webpack: (config, options) => {
config.module.rules.push({
test: /\.jsx/,
use: path.resolve('./transformMultipleClasses.js'),
});
return config;
},
IMPORTANT: use javascript to support webpack
IMPORTANT: Often, everything ends with the conversion of files, but if you have any problems, try to use this:
Adding to the tailwindcss configuration:
//tailwindcss.config.js
import transformMultipleClasses from './src/transformMultipleClasses.js';
const config = {
content: {
files: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],
transform: {
jsx: (content = '') => transformMultipleClasses(content),
// You can designate for any file extension
},
}
...
}
IMPORTANT: This setting is necessary for tailwindcss to understand what classes it needs to generate in a CSS file, but it does not work as a compiler for files. Details: https://github.com/tailwindlabs/tailwindcss/issues/13705#event-12857014225
IMPORTANT: You may need it for Vite/Rollup, but if it works without it, then you don't need it
https://www.npmjs.com/package/postcss-tailwindcss-multiple-classes
https://www.npmjs.com/package/rollup-plugin-tailwindcss-multiple-classes
Support Vite / Rollup
npm install --save-dev rollup-plugin-tailwindcss-multiple-classes
IMPORTANT: I advise you to install the plugin itself and the plugin for PostCSS for vite. If there is any error, install content.transform (in the installation section in webpack/next.js )
// vite.config.js
import tailwindMultipleClasses from "rollup-plugin-tailwindcss-multiple-classes";
export default defineConfig({
plugins: [tailwindMultipleClasses({ separator: ",", opBracket: "(", clBracket: ")" }), react()],
});
IMPORTANT: This plugin ignores all files in node_modules, as well as all CSS files and its derivatives. PostCSS is used for this
IMPORTANT: If you have any problems, try to rearrange this plugin and the 'react` plugin
FAQs
adding new functionality - merged pseudo-classes and pseudo-elements
We found that tailwindcss-multiple-classes 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.