w3c / wcag3

WCAG 3
https://w3c.github.io/wcag3/
Other
43 stars 10 forks source link

Proposal for a WCAG Content API #84

Open mpaiva opened 4 months ago

mpaiva commented 4 months ago

Background

The Web Content Accessibility Guidelines (WCAG) have been instrumental in guiding web developers and designers towards creating more accessible content. With the upcoming release of WCAG 3.0, there's an opportunity to further enhance accessibility practices by providing a programmatic way to access these guidelines.

Proposal

I propose the development of an API that allows the community to programmatically access WCAG content. This API would serve as a centralized, authoritative source for the guidelines, enabling developers to integrate accessibility standards directly into their tools and applications.

Key Features

  1. Guideline Retrieval: Access detailed information about specific WCAG guidelines, including descriptions, success criteria, and examples.
  2. Search Functionality: Search for guidelines based on keywords, criteria, or tags.
  3. Updates and Notifications: Receive updates on changes or additions to the guidelines.
  4. Integration Support: Enable integration with popular development tools and platforms (e.g., Figma, Penpot, Tokens Studio).
  5. Design Recommendations: Provide WCAG-based recommendations for design decisions, available as design tokens for use in design systems.

Benefits

Technical Specifications

Community Involvement

To ensure the success of this API, we invite the community to contribute ideas on how this API could be used. For instance, I have already created a Figma plugin using a local static JSON version of WCAG 2.2. This plugin enhances the accessibility of digital designs by integrating accessibility guidelines directly into your design processes and systems. It's a simple Figma plugin that offers three key features:

Note on Design Tokens: Building on this, we propose extending the utility tokens feature to provide WCAG-based recommendations for design decisions. These recommendations will be made available as design tokens, which can be easily integrated into design systems. Design tokens are a way to store design decisions as reusable variables, ensuring consistency and accessibility across all design elements and components.

Examples of how the Community could use the API:

I'd encourage everyone who reads this post to contribute additional ideas on how the WCAG Content API could be utilized. Whether you're a developer, designer, educator, or accessibility advocate, your insights and suggestions are invaluable. Here are some initial ideas:

The community contributions and feedback will be invaluable in refining the API and making it more useful for a wide range of users.

Conclusion

By developing a WCAG Content API, we can make it easier for developers to create accessible web content and foster a more inclusive digital environment. I look forward to hearing your thoughts and collaborating on this initiative.

GreggVan commented 4 months ago

I'm sure this will be more difficult than it first sounds, and there may be some unintended consequences -- but I think it could be a really useful tool/capability to explore. It can't be THE authoritative reference I don't think (replacing the published document) - but it could be the best way to incorporate (accurately) the guidelines and recommendations.

AND with WCAG3 and our intention to couple recommendations with requirements to extend them beyond the "testable" limits -- this could be really helpful --- AS LONG AS you can't pull just the required and not get the recommended along with them....

mpaiva commented 4 months ago

Agreed @GreggVan - developing this API will have its challenges and we need to be mindful of any unintended consequences. The API isn't meant to replace the official WCAG documents but to make it easier to use the guidelines accurately in different tools.

It's important that the API includes both the required guidelines and the recommended best practices, especially with the new WCAG 3.0 updates. This way, users will get a complete picture of what’s needed for accessibility.

Here's an example of an absolute recommendation (WCAG 2.5.8) that could be readily integrated into design systems:

 [ 
 "2-5-8 Target Size (AA)/wcag-target-size-minimum-px": {
    "$type": "number",
    "$value": "24",
    "$description": "WCAG 2.5.8 (AA v2.2) - Specifies the minimum size for target areas of pointer inputs, ensuring ease of interaction."
  },
  "2-5-8 Target Size (AA)/wcag-target-size-minimum-half-px": {
    "$type": "number",
    "$value": "12",
    "$description": "WCAG 2.5.8 (AA v2.2) - Specifies the minimum size for target areas of pointer inputs, ensuring ease of interaction."
  },
  "2-5-8 Target Size (AA)/wcag-target-size-minimum-quarter-px": {
    "$type": "number",
    "$value": "6",
    "$description": "WCAG 2.5.8 (AA v2.2) - Specifies the minimum size for target areas of pointer inputs, ensuring ease of interaction."
  }
]

This uses the proposed Design Tokens Format Module (Draft)

https://design-tokens.github.io/community-group/format/

mraccess77 commented 4 months ago

An API would be helpful in pulling in techniques, methods, or tests into accessibility testing tools and platforms. I believe today there are some XML indexes that can be used for some of this but a more modern approach would be beneficial.

patrickhlauke commented 4 months ago

Providing an API (with actual endpoints that can be queried dynamically), versus just providing the entire structure in a machine-readable format (as @mraccess77 mentions, there's XML today, but perhaps something like JSON). I'd say my preference would be for this, rather than trying to design endpoints/functions

patrickhlauke commented 4 months ago

while this is tangential, @mpaiva i'm wondering in your example above about the half and quarter pixel variants of the SC ... and noting that that criterion uses density-independent CSS pixels, so not quite sure what to make of those half/quarter measures

mpaiva commented 4 months ago

When creating and building design systems we could use multiples or partials of a unit to provide spacing definitions for padding, gaps, margins, etc.

In the example above, if a designer is not using a graph engine like Tokens Studio, which has a robust math support, they can add those partials directly as Figma variables when creating the sufficient target size for buttons, inputs or links.

mpaiva commented 4 months ago

Here's another example I use as a "team ritual" during stand-ups. At the end of each stand-up gathering, I share one WCAG guideline with the team. Discuss use-cases, best-practices, then ask if there are any questions. This ritual takes less than 5 min and we all learn together.

Having an API like this would foster creativity in how technologists consume and understand the WCAG content.

For the WCAG Quotes example, I created a static JSON file and augmented the additional content, like quotes, images, captions, etc.

The attached image is a screenshot of four slides for a presentation on the recommendation 1.4.7. The theme for this application is to use the end-users perspective when they face the barriers the SC is trying to solve.

1 4 7