
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@fabien0102/tailwind-aria
Advanced tools
A plugin that provides variants for various aria-*
attributes and their supported
values.
Forked from @thoughtbot/tailwindcss-aria-attributes to fix some issues.
Install the npm package.
pnpm i -D @fabien0102/tailwind-aria
Add the plugin to your tailwind configuration.
--- tailwind.config.ts
+++ tailwind.config.ts
export default {
plugins: [
+ require("@fabien0102/tailwind-aria"),
]
}
There are two styles of attributes supported by the variants: boolean attributes, and enumerated values.
In some cases, attributes belong to both groups.
Variants for boolean attributes are active when the value is "true"
and only
"true"
. When the attribute is missing or the value is "false"
, its other
applicable utility classes are applied.
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>
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, its other applicable utility classes are applied.
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>
FAQs
TailwindCSS aria-* attribute utilities plugin
We found that @fabien0102/tailwind-aria demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.