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] use spacing tokens names instead of values #2140

Open
bennypowers opened this issue Jan 26, 2025 · 7 comments · May be fixed by #2156
Open

[docs] use spacing tokens names instead of values #2140

bennypowers opened this issue Jan 26, 2025 · 7 comments · May be fixed by #2156
Assignees
Labels
docs Improvements or additions to documentation

Comments

@bennypowers
Copy link
Member

Description

This was briefly discussed in chat over the weekend. Docs pages should use token names for spacing instead of pixel values. e.g. Guidelines pages for elements or patterns should read "vertical spacing is --rh-space-xl" instead of "vertical spacing is 24px"

I found the following instances of one or more digits followed by "px", surrounded in backticks

elements/rh-tag/docs/10-style.md
140:The tag border changes to `--rh-border-width-md` or `2px` on hover.

elements/rh-avatar/docs/20-guidelines.md
72:There is `48px` of space when avatar groups are stacked vertically.

elements/rh-button/docs/20-guidelines.md
235:The standard spacing between each button is `16px`, even for Danger
237:`8px`.

elements/rh-accordion/docs/20-guidelines.md
82:not exceed `750px` to maintain optimal readability.

elements/rh-cta/docs/20-guidelines.md
296:`24px`.
312:Horizontal and vertical spacing between the Default variant is `24px`.

Links

https://ux.redhat.com/elements/call-to-action/guidelines/#space-in-groups

Screenshots

No response

Additional context

No response

@coreyvickery
Copy link
Collaborator

@marionnegp Is this effort worth creating a doc or spreadsheet to capture all instances?

@marionnegp
Copy link
Collaborator

@marionnegp Is this effort worth creating a doc or spreadsheet to capture all instances?

Probably not. It'll double the amount of time spent looking for the instances, and you'll be able to view where changes were made within the PR. It would be good to have someone double check the DP- version of the site and review that instances weren't missed.

@bennypowers
Copy link
Member Author

bennypowers commented Jan 29, 2025

rg "`#\d{3,6}`" **/*.md

ripgrep is our friend

This one should help identify hex colours in backticks

The search from above, expanded to include more units

rg "`[\d.]+(px|%|r?em)`" **/*.md

https://github.com/BurntSushi/ripgrep?tab=readme-ov-file#installation

@marionnegp
Copy link
Collaborator

ripgrep is our friend

Thank you, @bennypowers!!

@marionnegp
Copy link
Collaborator

@bennypowers, is it useful to keep the number values in README files? Should those be replaced? For example, ripgrep found:

elements/rh-navigation-secondary/README.md
157:| `--rh-navigation-secondary-logo-max-width` | `10em` |
214:| `--rh-navigation-secondary-menu-section-grid-gap` | `2em` |
215:| `--rh-navigation-secondary-menu-content-max-width` | `1136px` |

@marionnegp
Copy link
Collaborator

I'm going to leave the 750px found in the accordion docs. We don't have a token value for that, and it's referring to a max width for the text.

@bennypowers
Copy link
Member Author

@marionnegp if there's a token name for those values, why not replace them in the READMEs, too?

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
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

3 participants