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

Flow Steps: Vertical variant #254

Merged
merged 7 commits into from
Aug 6, 2020

Conversation

havgry
Copy link
Contributor

@havgry havgry commented Jul 7, 2020

This has been bugging me for quite some time - the labels in the flow steps component are hidden below a certain viewport width like so:
Screenshot 2020-07-07 at 21 56 38
This renders the component pretty useless for seeing people not relying on the aria attributes. I propose we introduce a vertical variant (I even believe Bo designed something similar):
Screenshot 2020-07-07 at 21 57 08
The reasons for introducing a variant instead of just using media queries are two-fold:

  1. Avoiding introducinging breaking changes in the existing component
  2. Leaving it up to the designer and developer when to use what version

One caveat

If an item spans more than a couple of lines it will break
Screenshot 2020-07-07 at 21 58 54
This is because the connectors are built on the assumption that the distance between each bullet always is the same. Two possible solutions, as I see it: Always set a height on the container and let flexbox distribute the items evenly (easy), or change the connectors so they allow for various heights/widths of each item (a bit more work). That way we would also be able to do things like:
Screenshot 2020-07-07 at 22 51 25

Thoughts?

@havgry havgry requested review from dechowdev and grandorf July 7, 2020 20:58
@havgry havgry marked this pull request as draft July 8, 2020 07:35
@havgry havgry changed the title Flow Steps: Vertical variant (not ready to be merged) Flow Steps: Vertical variant Jul 8, 2020
@Nickhoyer
Copy link
Member

Nickhoyer commented Jul 8, 2020

I think the vertical variant makes a lot of sense, nice work 👏
I also think long text won't look good on these, even if the connectors allowed it.
It should lie on the content editors to make short labels for them.

I'm not a big fan of having to set height manually.

@havgry
Copy link
Contributor Author

havgry commented Jul 8, 2020

I also think long text won't look good on these, even if the connectors allowed it.

I agree, but I don't think the component should break when easily avoidable. If we could agree to always use the same connector background color we could prevent it from breaking and simplify the code at the same time. Right now there's a tiny difference in color, I only noticed when I started working on the component:
Screenshot 2020-07-08 at 14 22 46
It would still be possible with the color difference, but would require a bit more CSS.

Copy link
Contributor

@dechowdev dechowdev left a comment

Choose a reason for hiding this comment

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

There needs to be some thoughts put into the spacing and sizing of these bullets.
If these values are "given" by a designer they should be reconsidered.

If possible these should be aligned as well with the grid - if that is not possible (fine) - but we need to address that issue (with element sizing) in the DNA Spec as well.

There are some light improvements to be done Sass wise I'd love to see implemented for clarity's sake

havgry added 2 commits August 3, 2020 12:15
This is added as a way to display all green bullets without breaking the existing behaviour where it's only necessary to apply the "active" class to a single item.
@havgry havgry marked this pull request as ready for review August 3, 2020 10:30
@havgry
Copy link
Contributor Author

havgry commented Aug 3, 2020

Design: I've talked it over with Bo and he is ok with the change. We also talked about font weights which we will leave as is for now.

I've adressed all of @Dechowmedia's points (thanks for the review btw). I'm still looking for specific feedback regarding the caveat mentioned about multiple lines of text.

Also, I've introcued a small change in 9e4858e which allows for multiple active elements at the same time (visually, at least) like so:

BB_mobil_delivery_collapsed@2x

One could argue that it could be part of a different PR but I'm going to try and sneak it in...

Copy link
Member

@grandorf grandorf left a comment

Choose a reason for hiding this comment

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

I’m okay with introducing this variant, but I would prefer if the distance betweeen the bullets was the same size for UX and design purpose.
Design wise I think it looks better. UX wise I think that some users will think the the size of the step (the distance between the bullets) could mean the time required to fulfill the steps. However, that is only an assumption.
Would flexbox not be a better solution?

counter-reset: progress-bullet;
text-align: center;

#{$variant-vertical-ref} & {
Copy link
Member

Choose a reason for hiding this comment

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

I think this is difficult to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's either that or .ys-flow-steps--vertical & {, I guess. I don't have strong opinions about either one - I just tend to use the former. If you prefer the latter I'm happy to remove the refs.

@havgry
Copy link
Contributor Author

havgry commented Aug 4, 2020

Would flexbox not be a better solution?

It doesn't make much difference. In my proposal there's a minimum height for each item. If you wanted to automatically distribute the items with flexbox, you'd still need an explicit or implied height on the container - just like you have with the width on the horizontal variant. So basically we would have to require a height on the container. In that case I would rather set a specific height for each item allowing for at least two lines of text.

@havgry havgry requested a review from dechowdev August 6, 2020 07:33
@havgry havgry dismissed dechowdev’s stale review August 6, 2020 08:09

I'm dimissing this review, as Lucas's comments have either been addressed or fixed and as he's on vacation he's not able to give an approving review.

@havgry havgry merged commit 78eaca9 into youseedk:develop Aug 6, 2020
@havgry havgry deleted the feature/vertical-flow-steps branch August 6, 2020 08:10
havgry pushed a commit that referenced this pull request Aug 6, 2020
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.

4 participants