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

Merged
merged 6 commits into from
Oct 18, 2024
Merged

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 <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>

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

github-actions bot commented Oct 16, 2024

Flaky tests detected in 2db5ee2.
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/11386852895
📝 Reported issues:

@jameskoster
Copy link
Contributor Author

Pushed a couple of tiny adjustments, I reckon this is in a decent spot for an initial iteration.

Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

Let's merge and iterate 🚀

@ciampo ciampo enabled auto-merge (squash) October 18, 2024 00:32
@ciampo ciampo merged commit 86b09fb into trunk Oct 18, 2024
63 checks passed
@ciampo ciampo deleted the add/storybook-elevation-tokens branch October 18, 2024 01:09
@github-actions github-actions bot added this to the Gutenberg 19.6 milestone Oct 18, 2024
karthick-murugan pushed a commit to karthick-murugan/gutenberg that referenced this pull request Nov 13, 2024
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
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: 💫 Done
Development

Successfully merging this pull request may close these issues.

3 participants