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

Add elevation tokens to storybook #66122

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

jameskoster
Copy link
Contributor

Follow up to #65993.

What?

Adds elevation tokens section to storybook.

Why?

This makes them more discoverable and usable.

Testing Instructions

  1. npm run storybook
  2. Browse the Tokens -> Elevation section

The usage section definitely needs some input from an engineer. It would be good to include a section describing how to use the tokens in a third party app.

@jameskoster jameskoster requested review from a team October 15, 2024 11:53
Copy link

github-actions bot commented Oct 15, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@jameskoster jameskoster added [Type] Enhancement A suggestion for improvement. Design System Issues related to the system of combining components according to best practices. Storybook Storybook and its stories for components labels Oct 15, 2024
@jameskoster jameskoster mentioned this pull request Oct 15, 2024
7 tasks
@ciampo
Copy link
Contributor

ciampo commented Oct 16, 2024

Visually showing the different elevation options would be a great addition to this page, similarly to how we show the colors tokens — we should be able to do so by either creating an ad-hoc example for this page, or by using an existing component (ie. Elevation?)

The usage section definitely needs some input from an engineer. It would be good to include a section describing how to use the tokens in a third party app.

Do you mean adding a code snippet? For now, I guess a consumer would only be able to consume the token as Sass variables, right? This should then change one the Theme engine will be implemented and will provide tokens as CSS variables (cc @mirka)

@jameskoster
Copy link
Contributor Author

Do you mean adding a code snippet?

Yes

For now, I guess a consumer would only be able to consume the token as Sass variables, right?

I don't know :D I kind of assumed the properties in config-values.js were accessible too, but perhaps not?

Visually showing the different elevation options would be a great addition to this page, similarly to how we show the colors tokens — we should be able to do so by either creating an ad-hoc example for this page, or by using an existing component (ie. Elevation?)

Agreed. It would be nice to do it in an abstract way, but the Elevation component doesn't actually use values from the scale yet. So I suppose we'd need to use other components as examples.

@tyxla
Copy link
Member

tyxla commented Oct 16, 2024

Visually showing the different elevation options would be a great addition to this page, similarly to how we show the colors tokens — we should be able to do so by either creating an ad-hoc example for this page, or by using an existing component (ie. Elevation?)

That would be ideal. It's not something that can't be done in a separate PR, though. I'm fine with approaching these documentation pages in an incremental way.

@ciampo
Copy link
Contributor

ciampo commented Oct 16, 2024

I'll push an update later today with code snippets and a visual examples for each elevation

@ciampo
Copy link
Contributor

ciampo commented Oct 16, 2024

Pushed a couple of updates — here's what the page looks like now.

Screenshot 2024-10-16 at 20 16 39

Feel free to make amends, or to merge and improve it iteratively in follow-up PRs

Copy link

Flaky tests detected in d1a59b0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11371506436
📝 Reported issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design System Issues related to the system of combining components according to best practices. Storybook Storybook and its stories for components [Type] Enhancement A suggestion for improvement.
Projects
Status: 🏗️ In Progress
Development

Successfully merging this pull request may close these issues.

3 participants