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

[docs] Best Practices and Guidelines ("This / Not This") examples improvements #1449

Open
9 of 23 tasks
markcaron opened this issue Jan 19, 2024 · 7 comments
Open
9 of 23 tasks
Assignees
Labels
docs Improvements or additions to documentation for design Design work is requested needs discovery Needs discovery priority: high High priority

Comments

@markcaron
Copy link
Collaborator

markcaron commented Jan 19, 2024

Break up our "This / Not This" best practices and guidelines images and examples into separate images and columns (or cards), similar to what we do on our Brand site.

This will make it easier to scan as well as improve non-visual accessibility.

"This" and "Not this" should be HTML text paired with an icon.

Current situation

image

What we're looking for

image

Pages that will need to be updated:

Unchecked tasks with a PR number are in progress

@markcaron markcaron added docs Improvements or additions to documentation for design Design work is requested needs discovery Needs discovery priority: high High priority labels Jan 19, 2024
@markcaron markcaron added this to the 2024/Q1 — Chansey release milestone Jan 19, 2024
@marionnegp
Copy link
Collaborator

The Color page's Best Practices section uses this format.

This is a sample of what the Dos and Don'ts currently look like in code:

<div class="best-practices-grid">
    <div>
        <img slot="header" src="/assets/color/best-practices-custom-themes-correct.svg" alt="Blue submit button, blue default call to action, black tooltip, and blue switch">
        <h4 class="correct">Do</h4>
        <p>Use the color variants already available for elements and patterns.</p>
    </div>
    <div>
        <img slot="header" src="/assets/color/best-practices-custom-themes-wrong.svg" alt="Magenta button, brand red default call to action, green tooltip, and dark orange switch">
        <h4 class="wrong">Don't</h4>
        <p>Do not create your own colors, design tokens, or change the colors of existing elements and patterns.</p>
    </div>
</div>

It would be good to add this format as a shortcode.

@marionnegp
Copy link
Collaborator

Also, is there a preference for using "This"/"Not this" vs "Do"/"Don't"?

@markcaron
Copy link
Collaborator Author

Also, is there a preference for using "This"/"Not this" vs "Do"/"Don't"?

@marionnegp not really. I'm ok with using Do/Don't instead. Might be more of a common practice anyway.

@zeroedin
Copy link
Collaborator

zeroedin commented Feb 6, 2024

I did some initial work on this in #1465

https://deploy-preview-1465--red-hat-design-system.netlify.app/foundations/color/usage/#custom-themes

The variation looks a bit different then the examples above as I used a <figure> For the image. It seemed appropriate given the linked description of the images as the <figcaption>

image

Here is what the HTML looks like:

<uxdot-best-practice>
  <uxdot-example slot="do" no-border="" variant="full" alignment="left" color-palette="lightest">
    <figure>
      <img slot="header" src="/assets/color/best-practices-custom-themes-correct.svg" alt="Blue submit button, blue default call to action, black tooltip, and blue switch">
      <figcaption>Use the color variants already available for elements and patterns.</figcaption>
    </figure>
  </uxdot-example>
  <uxdot-example slot="dont" no-border="" variant="full" alignment="left" color-palette="lightest">
    <figure>
      <img slot="header" src="/assets/color/best-practices-custom-themes-wrong.svg" alt="Magenta button, brand red default call to action, green tooltip, and dark orange switch">
      <figcaption>Do not create your own colors, design tokens, or change the colors of existing elements and patterns.</figcaption>
    </figure>
  </uxdot-example>
</uxdot-best-practice>

This component can be tweaked however we deem necessary as I was just evaluating using a slotted <figure> in a uxdot-example for this use case.

Right now <uxdot-best-practice> has 2 slots do and dont and currently only only displays in a 2 up grid as that is the only use case I've ran across so far.

@marionnegp
Copy link
Collaborator

@zeroedin, using <figcaption> makes sense to me, though we might want to adjust the placement of the caption or "Do/Don't" heading.

There might be times we want to add more than one "do" or "don't" image (like if we split the two images in this audio player example) or have a best practice example be full-width.

@marionnegp marionnegp self-assigned this Feb 26, 2024
@marionnegp marionnegp moved this from Backlog to In Progress 🟢 in Red Hat Design System Feb 26, 2024
@zeroedin
Copy link
Collaborator

<uxdot-best-practice do> and <uxdot-best-practice dont> which use a figcaption in the shadowroot. It is available in #1465. This PR does not update any content.

I believe this issue partially an ask to update all Best Practice sections across the site to use this new style as well so will leave it open.

@coreyvickery
Copy link
Collaborator

coreyvickery commented Oct 28, 2024

@marionnegp

Screenshot 2024-10-26 at 10 29 22 PM
  • Use new icons
  • 8px of space in between icon and text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation for design Design work is requested needs discovery Needs discovery priority: high High priority
Projects
Status: In Progress 🟢
Development

No branches or pull requests

5 participants