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

Favourite/star is not button #1645

Closed
LukasHirt opened this issue Jul 29, 2019 · 10 comments
Closed

Favourite/star is not button #1645

LukasHirt opened this issue Jul 29, 2019 · 10 comments
Labels
Milestone

Comments

@LukasHirt
Copy link
Collaborator

Description

Favourite/Star button is not a button, therefore cannot receive focus

@DeepDiver1975 DeepDiver1975 added the Priority:p3-medium Normal priority label Aug 16, 2019
@LukasHirt LukasHirt added this to the backlog milestone Aug 23, 2019
@LukasHirt LukasHirt added the Topic:good-first-issue beginner friendly task label Sep 8, 2019
@PVince81
Copy link
Contributor

PVince81 commented Sep 9, 2019

I've examined a few possible approaches:

Approaches

Approach 1

  • update the "oc-star" element in the design system to include a new attribute "clickable". when set, wrap the icon with a "a href" element.
  • in Phoenix, set the "clickable" attribute

Approach 2

  • same as approach 1 but add the "clickable" on the "oc-icon" element.

Approach 3

  • simply wrap the the "oc-star" inside of Phoenix with an "a" element.

Approach 4

  • change "oc-button" to also allow for removing the border

Assumptions

  • sometimes we want star icons that are not clickable

Notes

I'm not sure yet how to decide what balance we want to have between having more logic in the design system or more in Phoenix.

@LukasHirt @felixheidecke

@PVince81
Copy link
Contributor

PVince81 commented Sep 9, 2019

in terms of reusability, one rule of thumb is to first add it in Phoenix (approach 3 + pending spinner) and then see later on how many times we'll want to reuse this logic.
one there is a clear requirement for reusability, refactor and move this into the design system

does that make sense ?

@LukasHirt
Copy link
Collaborator Author

LukasHirt commented Sep 9, 2019

I'd be actually in favour of approach 4 - button without border aka "link button". We need to adjust button component anyway to have the opportunity to use it like this also in other places + having a tag for action that doesn't lead user to any different page shouldn't be. For star that are not clickable I'd fallback to using simple oc-icon.

@LukasHirt
Copy link
Collaborator Author

There is already link button in uikit - https://getuikit.com/docs/button#style-modifiers

@PVince81
Copy link
Contributor

I've tried using variation="link" on the oc-button. it is currently not allowed and we could allow for it.

however it adds an extra margin left just because there happens to be a too general rule for spans inside of buttons here: https://github.com/owncloud/owncloud-design-system/blob/master/src/styles/theme/oc-button.scss#L25

if I can solve the latter we could use "oc-button" also with the link variant

@PVince81
Copy link
Contributor

Seems this is happening only because the "oc-star" is rendering two spans in the DOM, so when the second one is there it looks like there's an "oc-icon" followed by a span, to which the rule will shift the span to make room for the icon like it is done for the hamburger menu.

I'll see if I can change oc-star to only render a single element.

@PVince81
Copy link
Contributor

It worked.

Now struggling with paddings, trying to make the borderless button fit in the family:
image

I'm still wondering whether we should rather have another element "oc-link" or something as the internal paddings will likely be different than the ones of a button.

I'll push what I have currently on a PR

@PVince81
Copy link
Contributor

@PVince81 PVince81 removed their assignment Sep 3, 2020
@pascalwengerter
Copy link
Contributor

Will get resolved by #5018

@pascalwengerter
Copy link
Contributor

Fixed via #5000, coming to master soon

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 a pull request may close this issue.

4 participants