-
Notifications
You must be signed in to change notification settings - Fork 933
Refined prev/next buttons in course viewer #14399
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
base: release-v0.19.x
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -3,19 +3,22 @@ | |
| <div class="prev-next-bar"> | ||
| <!-- Prev button on the left --> | ||
| <KButton | ||
| class="btn-flex" | ||
| appearance="flat-button" | ||
| data-testid="prev-button" | ||
| :style="{ gap: showButtonLabels ? '8px' : '0px' }" | ||
|
Contributor
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. praise: Pragmatic workaround for the KButton empty-span gap issue — the inline |
||
| :disabled="!canGoPrev" | ||
| appearance="flat-button" | ||
| :aria-label="previousLabel$()" | ||
| :text="showButtonLabels ? previousLabel$() : ''" | ||
| @click="handlePrev" | ||
| > | ||
| <div class="btn-flex"> | ||
| <template #icon> | ||
| <KIcon | ||
| class="icon" | ||
| icon="back" | ||
| class="btn-icon" | ||
| :color="$themeTokens.text" | ||
|
Contributor
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. praise: Nice use of |
||
| /> | ||
| <span v-if="showButtonLabels">{{ previousLabel$() }}</span> | ||
| </div> | ||
| </template> | ||
| </KButton> | ||
|
|
||
| <!-- Progress/status in the center --> | ||
|
|
@@ -37,19 +40,22 @@ | |
| <slot name="actions"></slot> | ||
| </div> | ||
| <KButton | ||
| primary | ||
| class="btn-flex" | ||
| data-testid="next-button" | ||
| :style="{ gap: showButtonLabels ? '8px' : '0px' }" | ||
| :disabled="!canGoNext" | ||
| appearance="flat-button" | ||
| :aria-label="nextLabel$()" | ||
| :text="showButtonLabels ? nextLabel$() : ''" | ||
| @click="handleNext" | ||
| > | ||
| <div class="btn-flex"> | ||
| <span v-if="showButtonLabels">{{ nextLabel$() }}</span> | ||
| <template #iconAfter> | ||
| <KIcon | ||
| class="icon" | ||
| class="btn-icon hotfixed" | ||
| icon="forward" | ||
| :color="$themeTokens.textInverted" | ||
| /> | ||
| </div> | ||
| </template> | ||
| </KButton> | ||
| </div> | ||
| </div> | ||
|
|
@@ -168,12 +174,21 @@ | |
|
|
||
| .btn-flex { | ||
| display: flex; | ||
| gap: 4px; | ||
| align-items: center; | ||
| justify-content: center; | ||
|
|
||
| .icon { | ||
| top: 0; | ||
| padding: 8px; | ||
| font-weight: 600; | ||
| line-height: 135%; | ||
|
|
||
| .btn-icon { | ||
| top: -2px; | ||
| width: 16px; | ||
| height: 16px; | ||
|
|
||
| &.hotfixed { | ||
|
Contributor
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. praise: Good practice documenting the hotfix with a link to the upstream KDS PR — makes it easy to find and clean up later. |
||
| // Remove when https://github.com/learningequality/kolibri-design-system/pull/1219 is in KDS release | ||
| top: 0; | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
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 was a bit annoying but it's due to KButton internal
<span>s being present even if empty, so the gaps would be rendered and the arrow off-center unless I cleared the gap value like this.