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

Restructure checklist data #1268

Merged
merged 9 commits into from
May 9, 2021
Merged

Conversation

mxmason
Copy link
Member

@mxmason mxmason commented May 6, 2021

Unblocks some work in #940

Summary

This PR restructures checklist.json data so that each checklist category includes its own preface commentary. This allows us to loop over the checklist data to render each category in the list, resulting in a dryer template file.

Also:

  • includes_checklist.njk has been renamed to _includes/checklist__task.njk.

Before

{
  "content": [
    {
      "title": "Use plain language and avoid figures of speech, idioms, and complicated metaphors.",
      "checkboxId": "use-plain-language",
      "wcag": "3.1.5 Reading Level",
      "url": "https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-supplements.html",
      "description": "Write content at <a href='https://datayze.com/readability-analyzer.php'>an 8th grade reading level</a>."
    },
  ]
}

After

{
  "content": {
    "preface": "Content is the most important part of your site.",
    "tasks": [
      {
        "title": "Use plain language and avoid figures of speech, idioms, and complicated metaphors.",
        "checkboxId": "use-plain-language",
        "wcag": "3.1.5 Reading Level",
        "url": "https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-supplements.html",
        "description": "Write content at <a href='https://datayze.com/readability-analyzer.php'>an 8th grade reading level</a>."
      },
    ]
  }
}

@mxmason mxmason added the markup Issues dealing with markup label May 6, 2021
@mxmason mxmason requested a review from ericwbailey May 6, 2021 23:38
@mxmason mxmason self-assigned this May 6, 2021
@boring-cyborg boring-cyborg bot added checklist Updates for the web accessibility checklist data Issues with content sourced from JSON data files. styling Issues dealing with our Sass/CSS. labels May 6, 2021
@mxmason mxmason changed the title Feat/restructure checklist data Restructure checklist data May 7, 2021
Copy link
Member

@ericwbailey ericwbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love how DRY this is, thank you. A couple of pieces of feedback, but big-picture this is great.

src/checklist.njk Outdated Show resolved Hide resolved
src/css/components/_c-checklist.scss Outdated Show resolved Hide resolved
src/css/components/_c-checklist.scss Outdated Show resolved Hide resolved
@mxmason mxmason requested a review from ericwbailey May 9, 2021 16:09
Comment on lines +45 to +62

// u-text-transform-sentence-case
//
// Converts the text of an element into sentence case.
// NOTE: This utility is not recommended for elements that contain proper nouns,
// as it will convert those proper nouns to lowercase.

// Markup:
// <p class="u-text-transform-sentence-case">The first letter in this sentence will be capitalized.</p>
//
// Styleguide Utilities.Type Alignment.u-text-transform-sentence-case
.u-text-transform-sentence-case {
text-transform: lowercase;

&::first-letter {
text-transform: uppercase;
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericwbailey 👀 🔍

I've renamed the class to better describe what it does, as title case and sentence case are different. As a personal stylistic preference, I generally style my headings in sentence case, rather than title case. If you want something different for the headings in the checklist, I'm happy to use the text-transform-initial utility there instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also prefer sentence case. I think this is great, merging.

@mxmason mxmason mentioned this pull request May 9, 2021
Comment on lines +49 to +50
// NOTE: This utility is not recommended for elements that contain proper nouns,
// as it will convert those proper nouns to lowercase.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@ericwbailey ericwbailey merged commit 1d72c21 into main May 9, 2021
@ericwbailey ericwbailey deleted the feat/restructure-checklist-data branch May 9, 2021 23:05

<h2 id="keyboard" class="c-heading-large">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checklist Updates for the web accessibility checklist data Issues with content sourced from JSON data files. markup Issues dealing with markup styling Issues dealing with our Sass/CSS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants