Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@unocss/transformer-variant-group
Advanced tools
@unocss/transformer-variant-group is a transformer for UnoCSS that allows you to group variant utilities together, making your CSS more concise and easier to read.
Grouping Variants
This feature allows you to group multiple variant utilities together. In this example, the `hover` and `focus` variants are grouped to apply different background and text colors when the element is hovered or focused.
```html
<div class="hover:(bg-blue-500 text-white) focus:(bg-red-500 text-black)">
Hover or focus on me!
</div>
```
Nested Variants
This feature allows you to nest variants within responsive breakpoints. In this example, the `sm:hover` and `md:focus` variants are nested to apply different styles based on screen size and interaction state.
```html
<div class="sm:hover:(bg-green-500 text-white) md:focus:(bg-yellow-500 text-black)">
Responsive hover and focus!
</div>
```
Tailwind CSS is a utility-first CSS framework that provides low-level utility classes to build custom designs. It does not natively support grouping variants in the same way as @unocss/transformer-variant-group, but it offers a wide range of utilities and plugins for extended functionality.
Windi CSS is a next-generation utility-first CSS framework that is highly optimized for speed. It offers similar functionalities to Tailwind CSS and includes features like variant grouping through its own syntax, making it comparable to @unocss/transformer-variant-group.
Enables the variant group feature of Windi CSS for UnoCSS.
npm i -D @unocss/transformer-variant-group
import Unocss from 'unocss/vite'
import transformerVariantGroup from '@unocss/transformer-variant-group'
Unocss({
transformers: [
transformerVariantGroup(),
],
})
<div class="hover:(bg-gray-400 font-medium) font-(light mono)"/>
Will be transformed to:
<div class="hover:bg-gray-400 hover:font-medium font-light font-mono"/>
MIT License © 2021-PRESENT Anthony Fu
FAQs
Variant group transformer for UnoCSS
The npm package @unocss/transformer-variant-group receives a total of 158,113 weekly downloads. As such, @unocss/transformer-variant-group popularity was classified as popular.
We found that @unocss/transformer-variant-group demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.