-
Notifications
You must be signed in to change notification settings - Fork 226
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
Make metrics page font size consistent #1738
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kushalnl7, thank you for this PR.
I took a closer look at the issue, and I realized the main issue was that metrics.scss
does an @import "semantic-ui"
which imports semantic-ui/globals/all
. This unintentionally sets the font-size to 14px.
In contrast, the rest of the website that does not have this import statement will default to materialize's 15px (application.scss
imports materialize
, which imports materialize/components/typography
).
My recommendation
To target the root cause, could you instead set html's font-size to 15px inside assessts/stylesheets/metrics.scss
?
Let me know if you agree!
That's a great observation @damianhxy. I completely missed that. Thanks for pointing it out. But, the given solution would create more inconsistency as it sets up 15px size for the root element irrespective of the window-size. While the other pages would jump between {15px, 14.5px, 14px} depending on the window-size. Normal pages for lesser window size vs the 15px size of metrics page -Hence, the solution for this could be -
My opinion - I believe that the first method would work better in our situation because the alternative could lead to a recurrence of the font inconsistency problem as more new pages are added. The first option would give the developer the freedom to utilise various stylesheets without thinking about this problem. Let me know your views on this. |
Hi @kushalnl7, My thoughts on the first method is that declaring a font size on the navbar component is not addressing the root cause of the problem, and can lead to further inconsistencies down the road if future elements with For that reason, I prefer the second option, as we will be resetting the "environment variables" of the page by undoing unwanted changes by Thus, my recommendation would be to add the media queries to the metrics.scss file, and perhaps add a comment explaining the rationale for doing so. In fact, we could do it cleaner by adding a Let me know your thoughts on this! |
Hi @damianhxy , yes I think you are right about the inconsistencies that the 1st solution could create in future. Hence, I would also prefer for the second solution, considering that the future developers would keep this thing on their priority to maintain this consistency. While I am doubtful of directly importing |
@kushalnl7 That is true, importing materialize again is a rather heavy-handed approach. In that case, it would be fine to duplicate media queries to set the |
Hi @damianhxy, I have pushed the changes as per our discussion. Please review them. Thanks! |
Ohh, sorry for that. Resolved it now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, navbar text correctly sized on metrics page and responsive
Hi @damianhxy, I have committed the update. Thanks for pointing it out! |
Thanks @damianhxy. |
Regarding the issue mentioned in #1695 which focuses on inconsistency in fonts on different pages.
Description
As mentioned in #1695 using the two images of different pages, metrics page vs normal page, the former had a navbar menu with inconsistent font size than the others. After looking at the code, I could understand that the default value for navbar menu font is given to be "1rem". Hence, it takes the font-size from the root element.
Root element for normal page -
Root element for metrics page -
Due to this difference, there was a inconsistency in the font-size of navbar menu options. Hence, to resolve this, I added a new class to the navbar and defined a font-size for menu options in a css file.
Navbar menu options font after changes -
This makes the font-size consistent for all pages.
Motivation and Context
This solution is in regards to the issue - #1695
How Has This Been Tested?
The given additions resolve the issue as shown in above images and it does not affect other areas of code.
Types of changes
Checklist:
overcommit --install && overcommit --sign
to use pre-commit hook for linting