Skip to content

fix(theme): use correct tokens for the breadcrumbs #88

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

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

SamVerschueren
Copy link
Contributor

@SamVerschueren SamVerschueren commented Jun 21, 2024

When documenting the theming tokens, I noticed that some things didn't work correctly in regards the dropdown.

I also added 3 new tokens because I felt like it should be possible to style these things as well.

  • --tk-elements-breadcrumbs-dropdown-accordionTextColorSelected: The text color of the selected chapter/part in the dropdown.
  • --tk-elements-breadcrumbs-dropdown-accordionIconColorSelected: The icon color of the selected chapter/part in the dropdown.
  • --tk-elements-breadcrumbs-dropdown-lessonTextColorSelected: The text color of the selected lesson.

@donmckenna If we agree on these new tokens, do we need to document them in figma?

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Jun 21, 2024

⚠️ No Changeset found

Latest commit: e222956

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

--tk-elements-breadcrumbs-dropdown-accordionIconColorHover: var(--tk-text-primary);
--tk-elements-breadcrumbs-dropdown-lessonBackgroundColor: var(--tk-elements-breadcrumbs-dropdown-backgroundColor);
--tk-elements-breadcrumbs-dropdown-lessonBackgroundColorSelected: var(--tk-background-secondary);
--tk-elements-breadcrumbs-dropdown-lessonTextColor: var(--tk-elements-breadcrumbs-dropdown-textColor);
--tk-elements-breadcrumbs-dropdown-lessonTextColorHover: var(--tk-elements-breadcrumbs-dropdon-textColorHover);
--tk-elements-breadcrumbs-dropdown-lessonTextColorSelected: var(--tk-elements-breadcrumbs-dropdown-lessonTextColor);
--tk-elements-breadcrumbs-dropdown-lessonTextColorHover: var(--tk-elements-breadcrumbs-dropdown-textColorHover);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This had a typo dropdon instead of dropdown.

Copy link
Member

@Nemikolh Nemikolh left a comment

Choose a reason for hiding this comment

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

Looks good! I only left comment on unrelated stuff that I'm noticing with this PR.

Good job on this 😃

></span>
<span className={navStyles.AccordionTriggerText}>{`Part ${partIndex + 1}: ${part.title}`}</span>
<span className={`${navStyles.AccordionTriggerIcon} i-ph-caret-right-bold scale-80`}></span>
<span>{`Part ${partIndex + 1}: ${part.title}`}</span>
Copy link
Member

Choose a reason for hiding this comment

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

Oh I hadn't realised that we injected Part <index> in the title. This is not ideal when writing a Tutorial in a language other than English.

I feel like we should remove it but not in this PR though.

Curious to hear your thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OH you're right! We should do this differently.

Copy link
Member

Choose a reason for hiding this comment

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

Do you know why we have those classes? It's the first time I'm noticing this CSS module. 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At first I was moving all the UNO-css things inline. But then I realized it was annoying because that meant I had to copy and paste that every time the accordion trigger component is used.

So the classes are there (I think), so that you can just set navStyles.AccordionTrigger on the trigger, and the correct CSS is applied and you don't have to repeat the uno-css styles.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see. I would argue we should have "presentational" components though to avoid the repetition.

We can always revisit that later 👍

@donmckenna
Copy link

@SamVerschueren Yep, I'll put them in Figma, thank you!

@SamVerschueren SamVerschueren merged commit 1669299 into main Jun 24, 2024
8 checks passed
@SamVerschueren SamVerschueren deleted the fix/theming/breadcrumbs branch June 24, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants