-
Notifications
You must be signed in to change notification settings - Fork 85
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,14 +109,12 @@ function renderParts(navList: NavList, currentLesson: Lesson) { | |
navStyles.AccordionTrigger, | ||
'flex items-center gap-1 w-full hover:text-primary-700', | ||
{ | ||
'font-semibold': isPartActive, | ||
[`font-semibold ${navStyles.AccordionTriggerActive}`]: isPartActive, | ||
}, | ||
)} | ||
> | ||
<span | ||
className={`${navStyles.AccordionTriggerIcon} i-ph-caret-right-bold scale-80 text-tk-elements-breadcrumbs-dropdown-accordionToggleIconColor`} | ||
></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> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I hadn't realised that we injected I feel like we should remove it but not in this PR though. Curious to hear your thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OH you're right! We should do this differently. |
||
</Accordion.Trigger> | ||
<Accordion.Content className={navStyles.AccordionContent}> | ||
{renderChapters(currentLesson, part, isPartActive)} | ||
|
@@ -150,16 +148,20 @@ function renderChapters(currentLesson: Lesson, part: NavItem, isPartActive: bool | |
navStyles.AccordionTrigger, | ||
'flex items-center gap-1 w-full hover:text-primary-700', | ||
{ | ||
'font-semibold': isChapterActive, | ||
[`font-semibold ${navStyles.AccordionTriggerActive}`]: isChapterActive, | ||
}, | ||
)} | ||
> | ||
<span | ||
className={`${navStyles.AccordionTriggerIcon} i-ph-caret-right-bold scale-80 text-gray-300`} | ||
className={classNames( | ||
navStyles.AccordionTriggerIcon, | ||
'i-ph-caret-right-bold scale-80 text-gray-300', | ||
{ | ||
[navStyles.AccordionTriggerActive]: isChapterActive, | ||
}, | ||
)} | ||
></span> | ||
<span className="text-tk-elements-breadcrumbs-dropdown-accordionTextColor hover:text-tk-elements-breadcrumbs-dropdown-accordionTextColorHover"> | ||
{chapter.title} | ||
</span> | ||
<span>{chapter.title}</span> | ||
</Accordion.Trigger> | ||
<Accordion.Content className={navStyles.AccordionContent}> | ||
{renderLessons(currentLesson, chapter, isPartActive, isChapterActive)} | ||
|
@@ -183,10 +185,11 @@ function renderLessons(currentLesson: Lesson, chapter: NavItem, isPartActive: bo | |
<li key={lessonIndex} className="mr-3"> | ||
<a | ||
className={classNames( | ||
'w-full inline-block border border-transparent pr-3 hover:text-tk-elements-breadcrumbs-dropdown-textColorHover px-3 py-1 rounded-1', | ||
'w-full inline-block border border-transparent pr-3 text-tk-elements-breadcrumbs-dropdown-lessonTextColor hover:text-tk-elements-breadcrumbs-dropdown-lessonTextColorHover px-3 py-1 rounded-1', | ||
{ | ||
'bg-tk-elements-breadcrumbs-dropdown-lessonBackgroundColor': !isActiveLesson, | ||
'font-semibold bg-tk-elements-breadcrumbs-dropdown-lessonBackgroundColorSelected': isActiveLesson, | ||
'font-semibold text-tk-elements-breadcrumbs-dropdown-lessonTextColorSelected bg-tk-elements-breadcrumbs-dropdown-lessonBackgroundColorSelected': | ||
isActiveLesson, | ||
}, | ||
)} | ||
href={lesson.href} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. 👀 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 👍 |
There was a problem hiding this comment.
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 ofdropdown
.