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

USWDS -Site - Layout Grid: Guidance refactor #2276

Merged
merged 46 commits into from
Nov 6, 2024

Conversation

mahoneycm
Copy link
Contributor

@mahoneycm mahoneycm commented Sep 13, 2023

Summary

Refactored layout grid guidance to visually match other utility pages. The markdown now uses settings tables, includes mixin guidance, and now features the copy code button on code blocks.

Related issue

Closes #2210
Closes #2611

Preview link

Layout Grid guidance →

Problem statement

The layout grid guidance doesn’t match other utility guidance pages. Rather than using our site includes, it uses highlight code blocks to display spacing settings and mixin examples.

Solution

Utilize template includes to insert formatted tables and improve reader experience.

Warning

This PR removes the example at the bottom of the page which displayed how to use the mxins to create a two-column layout with a gap.
We should discuss if we would like to keep this example, refactor it, or keep it removed.

Testing and review

  1. Inspect the Layout Grid guidance page.
  2. Compare it to other utility guidance pages such as flex and confirm it matches the presentation style.
  3. Compare it to Layout Grid on develop and confirm no information is lost.
  4. On the develop build, review the example usage section that was removed from this PR. Consider if we want to keep this section, refactor it, or change it.

Testing checklist

  • Guidance matches presentation styles of other utility guidance pages.
  • No information is lost from change.
  • Method of presentation is up to par with USWDS-Site standards.
  • Confirm there are no responsive settings to include in Responsive variants settings table.
  • Approve of moving default responsive variant values to Responsive guidance at the bottom of the page.
  • Confirm all Utility mixins are accounted for in table and examples are suitable.
  • Consider if we need to add state variants and output control
    • I omitted because I did not see settings for display-grid in USWDS
  • Confirm “Example usage” section is not needed in it’s current state or consider refactor instead.

Comment on lines -86 to -93
<h2 id="responsive-variants">Responsive variants</h2>

<div>
<table class="usa-table--borderless site-table-responsive site-table-simple">
<caption>Default responsive sizes</caption>
<thead>
<tr>
<th scope="col" class="flex-2">Width</th>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved under the Responsive Variants guidance on line 517

@amyleadem amyleadem self-assigned this Dec 14, 2023
@amyleadem amyleadem changed the title USWDS - Layout Grid: Guidance refactor USWDS -Site - Layout Grid: Guidance refactor Mar 26, 2024
Copy link
Contributor

@amyleadem amyleadem left a comment

Choose a reason for hiding this comment

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

@mahoneycm Thanks for taking this on! I added some comments and suggestions below. Also, can you add a changelog to the page?

Let me know if you want to talk through the comments!

_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
@cathybaptista
Copy link
Contributor

cathybaptista commented Jul 15, 2024 via email

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

@mahoneycm thanks for these updates.

Two minor issues

  1. SCSS example mixins are missing semicolons.
  2. Values in mixin table don't match up.

_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Show resolved Hide resolved
@mejiaj mejiaj self-requested a review July 23, 2024 13:27
Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Thanks for the updates.


Build error is coming from HTMLProofer.

Details

#!/bin/bash -eo pipefail
npm run proof

> proof
> bundle exec htmlproofer --enforce-https=false --allow-missing-href=true --ignore-status-codes 0,403,429,503,302 --swap-urls 'https\://designsystem.digital.gov/:/' --ignore-urls '/github.com/uswds/uswds/issues/' --ignore-files '/whats-new/updates/2017/,/whats-new/updates/2018/,/documentation/code-guidelines/' ./_site

Running 3 checks (Scripts, Links, Images) in ["./_site"] on *.html files...


Checking 1219 external links
Checking 917 internal links
Checking internal link hashes in 225 files
Ran on 356 files!


For the Links > External check, the following failures were found:

* At ./_site/documentation/showcase/index.html:2714:

  External link https://commerce.gov/ failed: got a time out (response code 301) (status code 301)

@mahoneycm
Copy link
Contributor Author

mahoneycm commented Jul 23, 2024

@mejiaj I pulled in the latest from main and it looks like it resolved the HTML-Proofer error you mentioned, and introduced another.

For the Links > External check, the following failures were found:

* At ./_site/design-tokens/color/overview/index.html:3107:

  External link https://w3c.github.io/wcag/coga/gap-analysis.html failed (status code 404)


HTML-Proofer found 1 failure!

Exited with code exit status 1

Created #2753 to address

Copy link
Contributor

@amyleadem amyleadem left a comment

Choose a reason for hiding this comment

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

@mahoneycm Thanks for your patience with this review. I added a number of small suggestions and tweaks. I am hoping these are all that remains to fix.

_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
_utilities/layout-grid.md Outdated Show resolved Hide resolved
@mahoneycm mahoneycm requested a review from amyleadem July 25, 2024 16:21
_utilities/layout-grid.md Outdated Show resolved Hide resolved
Copy link
Contributor

@amyleadem amyleadem left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks @mahoneycm

@thisisdano thisisdano merged commit 9a9e62f into main Nov 6, 2024
11 checks passed
@thisisdano thisisdano deleted the cm-refactor-grid-guidance branch November 6, 2024 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants