Accessibility Coding Standards

The Drupal community strives to be inclusive to everyone, including people with disabilities. To that end, the Drupal community has developed the following accessibility coding standards to help make websites and other digital assets accessible to the widest possible audience.

Key Goals

Effective user experiences serve our entire community, including website visitors with disabilities. A positive experience can be achieved by focusing on three goals:

How to do an accessibility review?

Getting a sense of how accessible your module, theme or site is can seem like an overwhelming task. If you are new to accessibility, the sheer breadth of the topic can leave you wondering where to start. Accommodating a diverse range of abilities means there is a correspondingly diverse range of issues to consider. On this documentation, we have listed necessary considerations into a logical, step by step process for reviewing the accessibility of your module theme or site.

[Obsolete] JavaScript best practices

The standards have moved to GitLab pages, Drupal coding standards.

This page covers DOM and Drupal specific code styles.

JavaScript code placement

JavaScript code SHOULD NOT be embedded in the HTML where possible, as it adds significantly to page weight with no opportunity for mitigation by caching and compression.

Avoid hardcoding

The temptation to hardcode happens to the best of us - that's why even the best of us are at risk of being burned by it.

Hardcoding defined

Hardcoding is the practice of making code tailored to handle very specific cases. Here are some examples of hardcoding as applies to Drupal:

Subscribe with RSS Subscribe to RSS - best practices