Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: HeCAPTe 1.0.2 — Minor update available for module hecapte_captcha (1.0.2). Release: Attribution & Licensing 1.2.1 — Minor update available for module attribution (1.2.1). Release: MCP Sentinel 2.29.0 — Minor update available for module mcp_sentinel (2.29.0). Release: Audit Chain 1.10.9 — Minor update available for module audit_chain (1.10.9). Release: Menu Autopilot 1.4.7 — Minor update available for module menu_autopilot (1.4.7). Release: FileGate 1.11.3 — Minor update available for module file_gate (1.11.3). Release: Download Tracker 1.0.7 — Minor update available for module download_tracker (1.0.7). Release: Directory2Block Slideshow 1.0.8 — Minor update available for module directory2block_slideshow (1.0.8). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

WCAG Drawer

No security coverage
View on drupal.org

ACCESSIBILTY

Drawers should have aria attributes, and it's a pain in the ass. But it would
be a much bigger pain to have poor vision. Use the baby framework provided
by this module to create easy accessible drawers.

REQUIREMENTS

Begin by adding wcag_drawer/wcag-drawer as a dependency to your custom theme
or by attaching that library on desired pages.

Every drawer handle must have...

  1. class="wcag-drawer-handle"
  2. aria-controls="my-drawer-id"> //replace my-drawer-id with appropriate value

Every drawer must have...

  1. id="my-drawer-id" //this must correspond to the aria-controls attribute of the handle
  2. class="wcag-drawer"

It is recommended that your drawer handle be a button, but it could be a link
with role="button". After all, we're trying to be accessible. There are styles
in the library that remove most default button styles from a button given the
wcag-drawer-handle class.

BONUS CLASSES:

There are some bonus classes that do things. They are optional.

  • chevron: Add this class to the handle to give it a chevron
  • desktop-open: Add this to a wcag-drawer so force it open on desktop. It only really acts like a drawer on mobile. Put this on the handle too to hide the chevron.
  • load-open: Add this to a wcag-drawer to have the drawer load open. It canstill open and close like normal, which is different from th desktop-open class which only acts like a drawer on mobile.

BONUS ATTRIBUTES:

These are optional.

  • data-wcag-focus : Set to true on drawer if the drawer contains a form and you want to auto focus to the first form element. Make sure it's actually a string value of "true".
  • data-slide-time : This number gets passed to jquery slide() functions. The default is 400. It's a time in ms. If you want the drawer to open/close instantly add data-slide-time="0".

EXAMPLES:

<button class='wcag-drawer-handle chevron' aria-controls="my-drawer">Open!</button>
<div id="my-drawer" class='wcag-drawer' data-slide-time="0"> <!-- instant open/close -->
 <!-- STUFF IN DRAWER -->
</div>

or maybe...

<a role='button' class='wcag-drawer-handle desktop-open' aria-controls="my-drawer">Open!</button>
<div id="my-drawer" class='wcag-drawer desktop-open' data-wcag-focus="true">
 <!-- FORM IN DRAWER -->
</div>

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Apr 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.0-alpha4 Pre-release Apr 30, 2024