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

Align with start instead of center #88

Closed
wants to merge 1 commit into from

Conversation

MoshiKoi
Copy link
Member

@cellio
Copy link
Member

cellio commented Apr 21, 2023

I'd like to request a review from https://github.com/Taeir but I can't enter that in the reviewers list.

@cellio cellio requested a review from a team April 21, 2023 17:05
Copy link
Contributor

@Taeir Taeir left a comment

Choose a reason for hiding this comment

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

This change would affect more than the scores widget, right? For example this on the codesign website, i would expect the numbers to move to the left of the page.

Wouldnt it be better to have another class to more specifically state flex-start such that it overrides this definition?

36FED1EE-0F79-49C9-977F-6E78ED1650C1

@MoshiKoi
Copy link
Member Author

Hmn, presumably yes. I wonder what the best way of doing that is though; should I create the utility class in co-design and then if that gets merged in create a new pull request on qpixel to add that class to the score?

@trichoplax
Copy link

It's not just a need to be more specific. The layout is also width dependent. So there are 2 separate questions to consider:

  1. Are there things affected by the styling that we don't want to be affected?
  2. For the things we do want to style, how do we want them to appear at different widths?

The example @Taeir gives also applies to real Codidact question lists. If you resize the page to be narrow enough (or view on mobile) then the vote counts switch to be horizontal rather than vertical. Currently they are horizontally centered in this narrow view, but this pull request causes them to no longer be horizontally centered.

A CSS media query (line 76 in the same file src/common/_itemlists.scss) switches the vote counts to be horizontal rather than vertical. This is done by changing flex direction to row for .item-list--number-value. If this pull request is changed to also specify justify-content: center at this point then the vote counts should be correctly not centered in the wide view (where they are vertical) and correctly centered in the narrow view (where they are horizontal).

It still might be useful to have a more specific CSS selector though:

The example is fine on a narrow page (unaffected by ticking or unticking justify-content: center):

Narrow page with developer window showing the justify-content style set to center

The example loses the vertical centering for answers and votes on a wider page (most desktop screens):

Wide page with developer window showing the justify-content style set to center

Wide page with developer window showing the justify-content style not set to center

In this case it is quite a subtle difference in the vertical positioning of the answer count and vote count (easier to see in the highlighted row), but I guess still probably to be avoided?

@MoshiKoi
Copy link
Member Author

@trichoplax For what it's worth, the mobile view is off-center even now, due to the text being to the side. (The co-design website's examples are presumably a couple years out of date, given that they are completely different from qpixel proper.)

Screenshot_20230429-215811

@trichoplax
Copy link

Ah I see. I was thinking of that as already centered because there is equal empty space on both sides. It hadn't occurred to me that it should be the text that is centered, with the bar moved left to accommodate this.

Would it be easier to raise a separate issue / meta post to see if people would prefer centering the bar and text together, or just the text? If that's going to be addressed separately then we could match current behaviour in the meantime by adding the following at line 104:

justify-content: center;

@MoshiKoi
Copy link
Member Author

To be honest I think having the text to the side of the horizontal bar looks off regardless due to vertical height differences and such. Generally speaking the mobile view has quite a few problems with it that should probably get fixed at some point....

@MoshiKoi MoshiKoi closed this May 20, 2023
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.

Request: on post lists, align votes widget with title instead of centering vertically
4 participants