Skip to content

Instantly share code, notes, and snippets.

@yainspan
Created December 12, 2021 17:26
Show Gist options
  • Save yainspan/4013a60b8fcb3149259c6d523eb255dc to your computer and use it in GitHub Desktop.
Save yainspan/4013a60b8fcb3149259c6d523eb255dc to your computer and use it in GitHub Desktop.
group-last variant
const plugin = require("tailwindcss/plugin");
module.exports = {
...
plugins: [
...
plugin(function ({ addVariant, e }) {
addVariant("group-last", ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.group:last-child .${e(`group-last${separator}${className}`)}`;
});
});
}),
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment