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

button, router link, external link consistency and styling #166

Closed
indirectlylit opened this issue Feb 19, 2021 · 4 comments
Closed

button, router link, external link consistency and styling #166

indirectlylit opened this issue Feb 19, 2021 · 4 comments
Assignees
Labels
category: library Shared code library P1 - important Priority: High impact on UX type: issue Something isn't working
Milestone

Comments

@indirectlylit
Copy link
Contributor

indirectlylit commented Feb 19, 2021

Expected behavior

KButton, KRouterLink, and KExternalLink are styled exactly the same with 8px spacing between the icons and the text as here: #135 (comment)

Actual behavior

After merging in these PRs:

I see:

image

for:

<KExternalLink
  text="external (google)"
  href="https://google.com"
  icon="facility"
  iconAfter="facility"
/>
<br>
<KRouterLink
  text="router link (empty)"
  :to="{}"
  icon="facility"
  iconAfter="facility"
/>
<br>
<KButton
  text="button (alert)"
  appearance="basic-link"
  icon="facility"
  iconAfter="facility"
  @click="console.log('hello')"
/>

Additionally there are some discrepancies with the slots:

  • KButton has icon, default, and iconAfter which seems correct
  • KExternalLink is missing default and includes a slot called openInNewTab whose purpose is unclear
  • KRouterLink has no slots at all

Steps to reproduce the issue

Paste the code above into a test page

Environment

  • OS: MacOS
  • Browser version: Chromium and Firefox
@indirectlylit indirectlylit added category: library Shared code library P1 - important Priority: High impact on UX type: issue Something isn't working labels Feb 19, 2021
@indirectlylit
Copy link
Contributor Author

indirectlylit commented Feb 20, 2021

Another thing to watch out for is that the icon(s) and text should both fade to the hover color:

no icon hover icon hover with CSS transition
2021-02-19 16 59 37 2021-02-19 17 00 15

Also a bit subtle, but the timing of the hover transition is very slow compared to other components:

2021-02-19 17 37 56

@indirectlylit indirectlylit changed the title button, router link, external link consistency button, router link, external link consistency and styling Feb 20, 2021
@sairina
Copy link
Contributor

sairina commented Feb 25, 2021

Thanks for the information! Questions:

  1. KExternalLink:openInNewTab is from this issue, KExternalLink ought to open in new tab safely. From my understanding, providing true to this prop allows that link to open in another tab, instead of in the current tab. How might we adjust this to make sure it's more clear?
  2. KButton: What is the purpose of default? It is this one, correct?

https://github.com/learningequality/kolibri-design-system/blob/v0.2.x/lib/buttons-and-links/KButton.vue#L23

@indirectlylit
Copy link
Contributor Author

  1. KExternalLink:openInNewTab is from this issue, KExternalLink ought to open in new tab safely. From my understanding, providing true to this prop allows that link to open in another tab, instead of in the current tab. How might we adjust this to make sure it's more clear?

Yes the purpose of the prop named openInNewTab is totally clear:

/**
* If provided, opens link in new tab and displays a "pop out" icon
*/
openInNewTab: {
type: Boolean,
default: false,
},

I'm referring to the slot named openInNewTab which was probably added by mistake:

<slot name="openInNewTab">
<KIcon
v-if="openInNewTab"
icon="openNewTab"
style="top: 4px;"
:color="hovering ? $themeTokens.primaryDark : $themeTokens.primary"
/>
</slot>

  1. KButton: What is the purpose of default? It is this one, correct?

The default slot allows you to pass arbitrary sub-components into the button, which provides more flexibility than and takes precedence over the text prop

@indirectlylit
Copy link
Contributor Author

@sairina FYI I found the source of some of the frustrating underline issues we've had:

learningequality/kolibri#8907

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: library Shared code library P1 - important Priority: High impact on UX type: issue Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants