Socket
Socket
Sign inDemoInstall

@unocss/preset-attributify

Package Overview
Dependencies
1
Maintainers
1
Versions
356
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/preset-attributify


Version published
Maintainers
1
Install size
214 kB
Created

Package description

What is @unocss/preset-attributify?

@unocss/preset-attributify is a preset for UnoCSS that allows you to use attribute-based syntax for styling your HTML elements. This makes it easier to apply styles directly within your HTML tags, similar to how you might use inline styles, but with the power and flexibility of UnoCSS.

What are @unocss/preset-attributify's main functionalities?

Basic Styling

You can apply basic styles like text alignment, background color, and padding directly as attributes on your HTML elements.

<div text='center' bg='blue-500' p='4'>Hello World</div>

Responsive Design

You can use responsive design attributes to change styles based on different screen sizes.

<div sm:text='left' md:text='center' lg:text='right'>Responsive Text</div>

State Variants

You can apply styles for different states like hover and active using attribute-based syntax.

<button hover:bg='green-500' active:bg='green-700'>Click Me</button>

Utility Classes

You can use utility classes for layout and spacing directly as attributes.

<div flex='~ col' gap='4'>Flexbox Layout</div>

Other packages similar to @unocss/preset-attributify

Readme

Source

@unocss/preset-attributify

Attributify Mode for UnoCSS.

Documentation

Please refer to the documentation.

Credits

Initial idea by @Tahul and @antfu. Prior implementation in Windi CSS by @voorjaar.

License

MIT License © 2021-PRESENT Anthony Fu

Keywords

FAQs

Last updated on 26 Mar 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc