Styleguide - The A11Y Project

6 #Components Components

Components are collections of classes used to construct a user interface element.

Source: src/css/screen.scss, line 161

6.1 #Components.banner-a11y A11Y Banner

The A11Y Banner boldly and directly explains what the neuronym "A11Y" is, as well as the site's mission. It is meant to be placed inside the homepage's hero component.

Source: src/css/components/_c-a11y-summary.scss, line 1

6.2 #Components.get-started Get Started

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

The Get Started call-to-action provides a large guiding prompt for a person who is interested in learning about accessibility, but may not know where to begin.

Markup
<p class="c-cta-get-started">
  <a class="c-cta-get-started__link" href="">How do I get started?</a>
</p>
Source: src/css/components/_c-cta-get-started.scss, line 1

6.3 #Components.Headings Headings

Headings are used to identify sections of content. They are incredibly important for assistive technology. Heading component classes are used to control the visual presentation of heading elements, while preserving an accessible document structure.

Source: src/css/components/_c-headings.scss, line 1
Example

We quickly seized the black axle and just saved it from going past him

Markup
<h2 class="c-heading-smaller">
  We quickly seized the black axle and just saved it from going past him
</h2>
Source: src/css/components/_c-headings.scss, line 129
Example

While making deep excavations we found some quaint bronze jewelry

Markup
<h2 class="c-heading-smallest">
  While making deep excavations we found some quaint bronze jewelry
</h2>
Source: src/css/components/_c-headings.scss, line 143
Example

Six javelins thrown by the quick savages whizzed forty paces beyond the mark

Markup
<h2 class="c-heading-titanic">
  Six javelins thrown by the quick savages whizzed forty paces beyond the mark
</h2>
Source: src/css/components/_c-headings.scss, line 25
Example

The explorer was frozen in his big kayak just after making queer discoveries

Markup
<h2 class="c-heading-largest">
  The explorer was frozen in his big kayak just after making queer discoveries
</h2>
Source: src/css/components/_c-headings.scss, line 42
Example

The July sun caused a fragment of black pine wax to ooze on the velvet quilt

Markup
<h2 class="c-heading-larger">
  The July sun caused a fragment of black pine wax to ooze on the velvet quilt
</h2>
Source: src/css/components/_c-headings.scss, line 67
Example

The public was amazed to view the quickness and dexterity of the juggler

Markup
<h2 class="c-heading-large">
  The public was amazed to view the quickness and dexterity of the juggler
</h2>
Source: src/css/components/_c-headings.scss, line 84
Example

While Suez sailors wax parquet decks, Afghan Jews vomit jauntily abaft

Markup
<h2 class="c-heading-medium">
  While Suez sailors wax parquet decks, Afghan Jews vomit jauntily abaft
</h2>
Source: src/css/components/_c-headings.scss, line 99
Example

Six big juicy steaks sizzled in a pan as five workmen left the quarry

Markup
<h2 class="c-heading-small">
  Six big juicy steaks sizzled in a pan as five workmen left the quarry
</h2>
Source: src/css/components/_c-headings.scss, line 114

6.4 #Components.hero Hero

The Hero is a large box area used to showcase something important. On the homepage it displays the A11Y Banner component.

Source: src/css/components/_c-hero.scss, line 1
Source: src/css/components/_c-homepage-card.scss, line 1
Source: src/css/components/_c-homepage-feature.scss, line 1
Source: src/css/components/_c-linkroll.scss, line 1

6.8 #Components.lip Header Cap

The Header cap provides a "lip" area that sticks out below the header, provided the browser can support CSS Grid.

Source: src/css/components/_c-lip.scss, line 1
Source: src/css/components/_c-primary-nav.scss, line 1

6.11 #Components.post Post

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

A post component contains all content and information used for The A11Y project's blog posts.

Eleventy, the software that is used to generate this site, uses Markdown to convert blog post content into HTML code. Because of this, we use the class c-post as namespace that allows to easily create blog content-specific styling.

This allows site authors to continue to write in Markdown without having to worry about using both HTML markup and learning and applying site-specific styling classes. It also ensures that future styling work is decoupled from content.

Example
Markup
<div
  id="short-answer"
  class="l-post__content c-content"
  itemprop="articleBody"></div>
Source: src/css/components/_c-post.scss, line 5
Source: src/css/components/content/_inline-content.scss, line 30
Source: src/css/components/content/_inline-content.scss, line 108
Source: src/css/components/content/_embedded.scss, line 3
Source: src/css/components/content/_cms.scss, line 3
Source: src/css/components/content/_lists.scss, line 87
Source: src/css/components/content/_inline-content.scss, line 72

6.11.7 #Components.post.h2 Second-level Heading

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

This is the first content sectioning element to use, as the post's title uses a h1 element. Second-level heading styling is controlled using the heading-beta() mixin.

Example

How to navigate a website with a keyboard

Markup
<h2>How to navigate a website with a keyboard</h2>
Source: src/css/components/content/_headings.scss, line 21

6.11.8 #Components.post.links Links

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

Links navigate to other pages, or parts of the current page. There are two visual treatments for links, depending on if someone is browsing with a expressed preference for a reduced motion experience or not.

Example
Markup
<a href="URL">Link text</.>
Source: src/css/components/content/_links.scss, line 3
Source: src/css/components/content/_lists.scss, line 15
Source: src/css/components/content/_inline-content.scss, line 90
Source: src/css/components/content/_inline-content.scss, line 121
Source: src/css/components/content/_embedded.scss, line 12
Source: src/css/components/content/_lists.scss, line 53
Source: src/css/components/content/_embedded.scss, line 21

6.12 #Components.skipnav Skipnav

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

A skipnav, sometimes known as a jumpnav, allows someone to skip sections of content that are repeated from page to page. An example of this is skipping the main navigation that is repeated on every page of this site.

Skipnav is useful to people who use screen readers, as it allows them to quickly get to the main point of the page. It is also useful to people with motor control disabilities, as it lessens the amount of effort it takes to navigate.

A skipnav that links to the main content of the page should typically be the first thing you put in the code for your page templates. For The A11Y Project, it is the first piece of code used after the opening body element.

Markup
<a class="c-skipnav" href="#title">Skip to content.</a>
Source: src/css/components/_c-skipnav.scss, line 1