npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@thoughtbot/tailwindcss-aria-attributes

v0.2.0

Published

TailwindCSS aria- attribute utilities plugin

Downloads

14,301

Readme

@thoughtbot/tailwindcss-aria-attributes

A plugin that provides variants for various aria-* attributes and their supported values.

Installation

Install the plugin from npm:

# Using npm
npm install @thoughtbot/tailwindcss-aria-attributes

# Using Yarn
yarn add @thoughtbot/tailwindcss-aria-attributes

Then add the plugin to your tailwind.config.js file:

// tailwind.config.js
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require("@thoughtbot/tailwindcss-aria-attributes"),
    // ...
  ],
}

Usage

There are two styles of attributes supported by the variants: boolean attributes, and enumerated values.

In some cases, attributes belong to both groups.

Boolean attributes

Variants for boolean attributes are active when the value is "true" and only "true". When the attribute is missing or the value is "false", the typical application of utility classes will apply.

Currently, the collection of variants includes support for the following boolean attributes:

| Attribute | Variant |-------------------------------------------------------------------------------------|------------------------ | aria-atomic="true" | aria-atomic: | aria-busy="true" | aria-busy: | aria-checked="true" | aria-checked: | aria-current="true" | aria-current: | aria-disabled="true" | aria-disabled: | aria-expanded="true" | aria-expanded: | aria-grabbed="true" | aria-grabbed: | aria-haspopup="true" | aria-haspopup: | aria-hidden="true" | aria-hidden: | aria-invalid="true" | aria-invalid: | aria-live="true" | aria-live: | aria-modal="true" | aria-modal: | aria-multiline="true" | aria-multiline: | aria-multiselectable="true" | aria-multiselectable: | aria-pressed="true" | aria-pressed: | aria-readonly="true" | aria-readonly: | aria-required="true" | aria-required: | aria-selected="true" | aria-selected:

To utilize a boolean variant, prefix the attribute name with aria- and omit the value:

<ul role="listbox">
  <li role="option" class="aria-selected:border">Not selected</li>
  <li role="option" class="aria-selected:border" aria-selected="true">Selected</li>
</ul>

<button class="aria-disabled:cursor-not-allowed" aria-disabled="true">Submit</button>

Enumerated values

Variants for enumerated values are active when the value is equivalent to the variant's suffix.

When the attribute is missing or the value does not match the specified suffix, the typical application of utility classes will apply.

Currently, the collection of variants includes support for the following attributes and value combinations:

| Attribute | Variants | |------------------------------------------------------------------------|-------------------------------| | aria-autocomplete | aria-autocomplete-both: | | aria-autocomplete-inline: | | aria-autocomplete-list: | | aria-autocomplete-none: | aria-current | aria-current-date | | aria-current-location | | aria-current-page | | aria-current-step | | aria-current-time | aria-dropeffect | aria-dropeffect-copy | | aria-dropeffect-execute | | aria-dropeffect-link | | aria-dropeffect-move | | aria-dropeffect-none | | aria-dropeffect-popup | aria-haspopup | aria-haspopup-dialog | | aria-haspopup-grid | | aria-haspopup-listbox | | aria-haspopup-menu | | aria-haspopup-tree | aria-orientation | aria-orientation-horizontal | | aria-orientation-undefined | | aria-orientation-vertical, | aria-sort | aria-sort-ascending | | aria-sort-descending | | aria-sort-none | | aria-sort-other, | aria-relevant | aria-relevant-additions | | aria-relevant-all | | aria-relevant-removals | | aria-relevant-text

To utilize an enumerated value variant, prefix the attribute name with aria- and include the value:

<nav>
  <a class="aria-current-page:font-bold" href="/" aria-current="page">Root</a>
  <a class="aria-current-page:font-bold" href="/about">About us</a>
</nav>

License

tailwindcss-aria-attributes is Copyright (c) 2021 thoughtbot, inc. It contains free software that may be redistributed under the terms specified in the LICENSE file.

About

thoughtbot

This project is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software! See our other projects or hire us to help build your product.