New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@unifydev/unify-variant

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unifydev/unify-variant

UnoCSS Variants

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
13
550%
Maintainers
1
Weekly downloads
 
Created
Source

Unify-Variant

Variant for differents Components UI Libraries.

UnoUI-Variant

This is a preset package that provides variants for Components Libraries based on data-state attribute value, and help to create custom variant selector.

Data State Variants

Generate variants selector based on data-state attribute, however you can use it with other data-* attributes like (data-state="john" then fx-john:p4)

  • Radix
  • Flexilla
  • Radix Vue

fx-open:bg-red : will be applied if element has data-state='open'

browserVariant

Easily create custom variants for browser selector like ::moz-* ::webki...

Usage

Installation

npm i -D @unifydev/unify-preset

or

yarn add @unifydev/unify-preset -D

Or

bun add @unifydev/unify-preset -d

Config

In you uno.config.(js|ts) :

...
// import the packages
import {dataStateVariants, browserVariants} from '@unifydev/unify-variant'

export default defineConfig({
  // ...config
  variant:[
    dataStateVariants({
      prefix: 'fx', // prefix, you can use whatever you want as prefix
      variants: "visible|hidden|active|inactive|open|close|resize|minimize|maximaze", // indicate all values, those values will help to generate variant
      selector: "data-state" //Indicate the data-attribute to be used
    }),
    browserVariants({
      variants: {
          "meter-inner-el": "::-webkit-meter-inner-element",
          "meter-optimum-val": "::-webkit-meter-optimum-value",
          "metter-bar": "::-webkit-meter-bar",
          "moz-meter-bar": "::-moz-meter-bar"
      }
    }),
  ]
});

Use it

Now you can use :

  • metter-bar:bg-red

Contributing

If you're interested in contributing to Unify-UI, please read our contributing docs before submitting a pull request.

Join Our Community 🌍

Contribute, collaborate, and become a part of our mission 🚀

Support Us

If you like this project and want to support us, feel free to get in touch with one of maintainers :

Keywords

variants

FAQs

Package last updated on 20 Apr 2025

Did you know?

Socket

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.

Install

Related posts