Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@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 transformerVariantGroup from '@unocss/transformer-variant-group'
// uno.config.ts
import { defineConfig } from 'unocss'
export default defineConfig({
// ...
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 166,159 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.