Skip to content

feat: add design tokens and Container Section Card to Storybook#3744

Merged
andre-code merged 20 commits into
mainfrom
andrea/add-design-tokens-storybook
Feb 17, 2026
Merged

feat: add design tokens and Container Section Card to Storybook#3744
andre-code merged 20 commits into
mainfrom
andrea/add-design-tokens-storybook

Conversation

@andre-code
Copy link
Copy Markdown
Contributor

@andre-code andre-code commented Jun 26, 2025

This PR introduces foundational updates to our Storybook:

✅ What's included

  • Design Tokens: New stories for the following tokens used across our UI:

    • Colors
    • Spacing
    • Fonts
    • Borders & Shadows
    • Opacity
  • Container Section Card: First documented component added under the new structure, following improved documentation practices for component stories in Storybook.

📚 Why this matters

We’ve started reorganizing our Storybook to align with the Atomic Design methodology, which the design team also follows. This structure will help improve consistency, reusability, and collaboration between design and development teams.

Our new Storybook structure looks like this:

📁 Design Tokens
  ├── Colors ✅
  ├── Spacing ✅
  ├── Fonts ✅
  ├── Borders & Shadows ✅
  └── Opacity ✅

📁 Atoms
  ├── Button
  ├── Input
  ├── Badge
  └── Lists
      ...

📁 Molecules
  ├── Card
  │    └── ContainerSectionCard ✅
  ├── Modal
  └── ...

Ref: [Atomic Design by Brad Frost](https://bradfrost.com/blog/post/atomic-web-design/)

📌 Next steps / To-dos for upcoming PRs

  • Create a ContainerSectionCard component
  • Fix layout inconsistencies in related cards and sections:
    • Update Data connector card spacing (me-2 instead of gap-2)
    • Update "My Projects" and "My Group Projects" spacing to use .d-flex justify-content-between instead of ms-auto
    • Move description into the body for “Session Secret Slots” card and apply proper text styles
    • Add a Figma link to Storybook for design reference

References

/deploy
! RESTORE THE PREVIOUS POINTER to andrea/simplify-dc-form

fix #3551

@andre-code andre-code temporarily deployed to renku-ci-ui-3744 June 26, 2025 09:27 — with GitHub Actions Inactive
@RenkuBot
Copy link
Copy Markdown
Contributor

You can access the deployment of this PR at https://renku-ci-ui-3744.dev.renku.ch

@andre-code andre-code temporarily deployed to renku-ci-ui-3744 July 3, 2025 06:39 — with GitHub Actions Inactive
@andre-code andre-code force-pushed the andrea/add-design-tokens-storybook branch from 41a846c to 93aeed5 Compare July 3, 2025 07:17
@andre-code andre-code temporarily deployed to renku-ci-ui-3744 July 3, 2025 07:17 — with GitHub Actions Inactive
@andre-code andre-code marked this pull request as ready for review July 3, 2025 07:22
@andre-code andre-code requested a review from a team as a code owner July 3, 2025 07:22
@andre-code andre-code temporarily deployed to renku-ci-ui-3744 July 3, 2025 08:19 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-3744 July 4, 2025 07:05 — with GitHub Actions Inactive
@andre-code andre-code changed the title feat: add design tokens in Storybook feat: add design tokens and Section Content Card in Storybook Jul 4, 2025
@andre-code andre-code temporarily deployed to renku-ci-ui-3744 July 4, 2025 08:29 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-3744 July 4, 2025 08:47 — with GitHub Actions Inactive
@andre-code andre-code changed the title feat: add design tokens and Section Content Card in Storybook feat: add design tokens and Container Section Card in Storybook Jul 4, 2025
@andre-code andre-code changed the title feat: add design tokens and Container Section Card in Storybook feat: add design tokens and Container Section Card to Storybook Jul 4, 2025
@lorenzo-cavazzi lorenzo-cavazzi self-assigned this Jul 22, 2025
Copy link
Copy Markdown
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

I'm going through this PR and I have two main comments:

  • Design tokens: I like the level of detail! That should cover most of the needs of the design team. However, using static strings for the style attributes we wish to capture isn't the best approach. We would need to manually update those strings if we update anything on Bootstrap. We can check the rendered elements instead using getComputedStyle
  • Molecules: Great to include more examples and longer descriptions wherever necessary (Cards are a good example) but sections like "Layout & Spacing" or "Typography" seem unnecessary (E.G. we don't need to say that card's background are white, nor that the class .bg-white is applied -- which isn't the case) and hard to maintain in the long run (not extracted automatically).

In the reference pitch there was something about exporting to Figma but I don't see from here how it is done.

black: { value: "#000000", notes: "" },
},
text: {
"text-primary": { value: "#006e58" },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can get the values using a function like getComputedStyle instead of hardcoding

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @lorenzo-cavazzi for the review. I agree with your suggestions. I’ve refactored the code to retrieve values using getComputedStyle and removed the unnecessary information from the card component.

@andre-code andre-code force-pushed the andrea/add-design-tokens-storybook branch from 86b33ca to 8b43b46 Compare January 20, 2026 11:05
@andre-code andre-code force-pushed the andrea/add-design-tokens-storybook branch from 8b43b46 to aaedd1e Compare January 20, 2026 11:14
Copy link
Copy Markdown
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

Very nice! 👏

Just a couple of small changes before we merge.

className="p-3 bg-white d-flex flex-column"
style={{ height: 160 }}
>
<CopyRow
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great to have this common element!
The classes aren't consistent throughout the page (see screenshot). We could use the same visualization across all components on this page

Image

Comment on lines +28 to +48
grayscale: {
title: " Grayscale",
type: "color",
tokens: [
"white",
"light",
"dark",
"gray",
"gray-dark",
"gray-100",
"gray-200",
"gray-300",
"gray-400",
"gray-500",
"gray-600",
"gray-700",
"gray-800",
"gray-900",
"black",
],
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure we need to show all the gray shades since we generally don't use them directly through classes. I suggest we rename this section to "main colors", leave "white, black, light, dark", remove all the "gray-" variations and add the other main colors (danger, success, info, ...)

"body-font-weight": "Default font weight",
"body-line-height": "Default line height for readability",
},
fontSizes: ["fs-1", "fs-2", "fs-3", "fs-4", "fs-5", "fs-6"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
fontSizes: ["fs-1", "fs-2", "fs-3", "fs-4", "fs-5", "fs-6"],
fontSizes: ["fs-1", "fs-2", "fs-3", "fs-4"],

We can drop 5 and 6 since they are the same size of 3 and 4 and we generally don't use them anymore -- there are leftovers ofc, but most of them are on legacy pages.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems the spacing is applied twice vertically (see screenshot). There is some combination with padding in the parent container that doesn't work as expected

Image

@andre-code
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback, @lorenzo-cavazzi I’ve applied your suggestions.

@lorenzo-cavazzi
Copy link
Copy Markdown
Member

Very nice! 👏

There is still something off with the margins; everything else is fine 👍

Screenshot_20260209_133846

Copy link
Copy Markdown
Member

@lorenzo-cavazzi lorenzo-cavazzi left a comment

Choose a reason for hiding this comment

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

Lgtm! 🚀

@andre-code andre-code merged commit c19ee9a into main Feb 17, 2026
24 checks passed
@andre-code andre-code deleted the andrea/add-design-tokens-storybook branch February 17, 2026 10:25
@RenkuBot
Copy link
Copy Markdown
Contributor

Tearing down the temporary RenkuLab deplyoment for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Storybook: add more colors and text styles

3 participants