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

699 Update responsive design up to 200% zoom #727

Closed
wants to merge 2 commits into from

Conversation

Kenny4297
Copy link

Description

I have implemented media queries across all CSS files pertaining to the Header. These modifications ensure proper display and functionality of the header at up to 200% zoom.

Screenshots

Here's how the header looks at 200% zoom:
200Zoom

Notes

While this project's structure—with multiple components and corresponding CSS files—works well with JavaScript logic implementation, it presents challenges in styling, particularly for the header.

Concerns

In my personal opinion, I would be worried about the scalability of this project when it comes to responsive design. Although it is possible to make this application responsive, the fact that multiple CSS files are used (and scattered) throughout the application with regards to one section of the application (the header, for example) will make responsive design difficult.

Thanks for letting me contribute!!

@pmarsh-scottlogic
Copy link
Contributor

Hiya @Kenny4297 - that was fast work!

Regarding the concerns - yes, I agree it is hard to make the site responsive! Have you come across any project structures that better enable responsive design? Any examples? We're happy to learn!

Make sure you run the formatter on the frontend - the workflow is complaining. (cd frontend then npm run format)

And finally a heads up and apology - all the maintainers work on this as part of our day job, and it is coming up to Christmas hols, so I'm afraid we'll only be able to give this PR some attention after the new year. So take care until then :)

p.s. for my own interest, how did you come across the project?

@pmarsh-scottlogic pmarsh-scottlogic changed the title Update responsive design up to 200% zoom, Issue #669 669 Update responsive design up to 200% zoom Dec 22, 2023
@pmarsh-scottlogic pmarsh-scottlogic changed the title 669 Update responsive design up to 200% zoom 699 Update responsive design up to 200% zoom Dec 22, 2023
@pmarsh-scottlogic pmarsh-scottlogic linked an issue Dec 22, 2023 that may be closed by this pull request
@Kenny4297
Copy link
Author

Kenny4297 commented Dec 22, 2023 via email

Copy link
Contributor

@pmarsh-scottlogic pmarsh-scottlogic left a comment

Choose a reason for hiding this comment

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

I think it's a great idea to incorporate media queries to help with different sizes. I have a few main comments to make to start with.

I would prefer to not change so much of the font sizing in the media queries. Since all the font sizes are defined in rem already, it means that when you adjust the zoom level, all the fonts will scale exactly according to that zoom level.

I notice that, on my laptop screen, the header fonts appear smaller at zoom levels 150% and 200% when compared to 100%! We'd really like to avoid this since the idea behind us supporting zoom levels is mainly to support users who struggle with sight. We'd much prefer to adjust the layout, and padding to make room rather than adjusting fonts. See the screenshot on the issue (labelled "Roughly expected outcome") :)

I wonder if, to support our current css structure, we could put the media queries within our classes? So instead of

@media (...) {
  .my-class {...}
  .my-other-class{...}
}

we do
```css
.my-class {
  @media(...){...}
}

.my-other-class {
  @media(...){...}
}

These are my first thoughts as I look at the PR. It might be worth waiting a couple of weeks for the more senior folk on my team to respond because they might disagree with me, or have more concrete suggestions.

Again, sorry that the PR isn't getting so much attention at the minute! In the next week or two, we'll get back to our regular schedules and have time to look at it.

Comment on lines +20 to +23
@media (max-width: 760px) {
.themed-button img {
display: none;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea of hiding icons to make space

flex-shrink: 1;
}
.main-header {
padding: 0rem 0rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

can be shortened

Suggested change
padding: 0rem 0rem;
padding: 0;

height: 3.5rem;
}
.main-header-right {
gap: 0rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

can be shortened to

Suggested change
gap: 0rem;
gap: 0;

@media (max-width: 760px) {
.main-header .themed-button {
font-size: 0.5rem;
padding: 0.4rem 0.4rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
padding: 0.4rem 0.4rem;
padding: 0.4rem;

@Kenny4297
Copy link
Author

Kenny4297 commented Dec 29, 2023

I really like the changes that have been implemented. I'd like to provide some additional insights:

1) Scaling of Font Sizes with Zoom Levels

Observation:

"Since all the font sizes are defined in rem, it means that when you adjust the zoom level, all the fonts will scale exactly according to that zoom level."

Comment:

  • This statement may not be entirely accurate. rem units are relative to the root element's font size, not directly responsive to changes in the window size like percentages or viewport units (vw, vh).
  • To make font sizes responsive to window size using rem, you would typically adjust the root element's font size with media queries.

Suggestion:

  • What you could do is set the root font sizes through media queries. This way, font sizes defined in rem within those roots would change automatically in response to window size adjustments.

2) Shortening '0rem' to '0'

Proposal:

  • Add all these modifications to your formatter!. This could streamline the process and ensure consistency across the codebase.

Note:

  • Due to my current workload, I might not be able to revisit this for the next few months. I'm grateful for the opportunity to contribute and look forward to seeing how this project progresses.

Thanks for letting me work on this!

Best regards,
Kedgard

@gsproston-scottlogic
Copy link
Contributor

Hi Kedgard,

Thanks for your work on this, and your patience while most of us were away over the winter break.
If you're unable to work on this for the next few months, I'll close this PR if that's all right.
Again, thank you for your work and your insight regarding the project structure and adding formatting rules for CSS, we'll definitely be looking into those!

Kind regards,
George

@chriswilty
Copy link
Member

chriswilty commented Jan 4, 2024

@Kenny4297 FWIW We've not really looked into responsive design yet, and we don't even have issues in our backlog for it, at the moment, as there are UX challenges around using this application on smaller devices. That being said, as you suggest we would likely want to use a limited set of media queries to set some values application-wide, such as base font size and maybe a spacing/padding strategy.

Zoom is of course tricky, because it can affect which media query is active. We could maybe use resolution in dppx to distinguish if we are zoomed in or just on a smaller device. As @pmarsh-scottlogic points out, we don't really want an increase in zoom to decrease the font size.

@pmarsh-scottlogic
Copy link
Contributor

pmarsh-scottlogic commented Jan 8, 2024

Hi @Kenny4297

We're closing the PR for now since you won't have time to work on it, and we'd like to discuss within the team and be sure on what the outcome of the issue should be before work continues. Apologies that the requirements weren't crystal clear. Also in hindsight, it might be a bit in-depth for a "good first issue".

That being said, it was good to have somefresh insight to inform our choices going forward. In particular, we're already working to add some css linting to deal with the 0rem problem :)

If you want to continue work on the issue when you have more free time, then please leave us a comment and we'll happily discuss!

Happy new year

@Kenny4297
Copy link
Author

Thanks again for letting me work on it! I'll reach back out if I get some time for either this issue or others!

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.

Adjust header and footer for text resizing [a11y]
4 participants