Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DP-9177 a11y rules of court header #1617

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions changelogs/DP-9177.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Changed:
- project: Patternlab
component: PageHeader
description: Semantically set up page category info. (#1617)
issue: DP-9177
impact: Patch

- project: Patternlab
component: RulesOfCourt
description: Add contextual info to comp headings. (#1617)
issue: DP-9177
impact: Patch
15 changes: 15 additions & 0 deletions packages/assets/scss/03-organisms/_page-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ $page-header-widget-width: 350px;
text-transform: uppercase;
}

&__subCategory {
padding-bottom: 15px;
color: $c-font-base;

@include ma-heading(3);

@include ma-comp-heading($c-primary-alt);

@include ma-border-decorative;

&:after {
width: 1.85em; // ma-underline-decorative override
}
}

&__title {
margin-bottom: .4em;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,31 @@
</div>
{% endif %}
{% if pageHeader.category %}
<div class="ma__page-header__category">
{{ pageHeader.category }}
<div id="page-category" aria-hidden="true">
<div class="ma__page-header__category">
<span class="visually-hidden">This page is under the category of </span>
{{ pageHeader.category }}
</div>
{% if pageHeader.subCategory %}
<div class="ma__page-header__subCategory">
<span class="visually-hidden">the sub category of </span>
{{ pageHeader.subCategory.title }}
</div>
{% endif %}
</div>
{% endif %}

{% if pageHeader.subCategory %}
<div class="ma__page-header__subCategory">
{% set subCategoryLevel = pageHeader.subCategory.level ?: 3 %}
{% set compHeading = pageHeader.subCategory|merge({'level':(subCategoryLevel)}) %}
{% include "@atoms/04-headings/comp-heading.twig" %}
</div>
{% endif %}
{% if pageHeader.nested %}
<h1 class="ma__page-header__title">{% if prefix %}<span class="visually-hidden">{{ prefix }}&nbsp;</span>{% endif %}{{pageHeader.title}}
<h1 class="ma__page-header__title" {% if pageHeader.category %}aria-describedby="page-category"{% endif %}>
{{pageHeader.title}}

{% if pageHeader.subTitle %}
<div class="ma__page-header__sub-title">{{pageHeader.subTitle}}</div>
{% endif %}
</h1>
{% else %}
<h1 class="ma__page-header__title">{% if prefix %}<span class="visually-hidden">{{ prefix }}&nbsp;</span>{% endif %}{{pageHeader.title}}
<h1 class="ma__page-header__title" {% if pageHeader.category %}aria-describedby="page-category"{% endif %}>
{{pageHeader.title}}
</h1>
{% if pageHeader.subTitle %}
<div class="ma__page-header__sub-title">{{pageHeader.subTitle}}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
"formDownloads": {
"compHeading": {
"title": "Downloads",
"titleContext": "for The Name of a Court Rule",
"sub": false,
"color": "",
"id": "downloads",
Expand Down Expand Up @@ -264,6 +265,7 @@
"viewSpecific": false,
"compHeading": {
"title": "Contact",
"titleContext": "for The Name of a Court Rule",
"sub": false,
"color": "",
"id": "contact",
Expand Down Expand Up @@ -399,6 +401,7 @@
"viewSpecific": true,
"compHeading": {
"title": "Contact",
"titleContext": "for The Name of a Court Rule",
"sub": false,
"color": "",
"id": "",
Expand Down Expand Up @@ -436,7 +439,8 @@
},
"pressListing": {
"sidebarHeading": {
"title": "Related"
"title": "Related",
"titleContext": "to The Name of a Court Rule"
},
"items": [
{
Expand Down Expand Up @@ -479,7 +483,8 @@
},
"eventListing": {
"sidebarHeading": {
"title": "Events"
"title": "Events",
"titleContext": "for The Name of a Court Rule"
},
"events": [
{
Expand Down