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

Font-stack not documented and applied to few elements only #175

Closed
RamonvdW opened this issue Sep 4, 2021 · 7 comments · Fixed by #212
Closed

Font-stack not documented and applied to few elements only #175

RamonvdW opened this issue Sep 4, 2021 · 7 comments · Fixed by #212
Labels
css/sass For something that related to styling/view documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@RamonvdW
Copy link

RamonvdW commented Sep 4, 2021

The font-family that is set in html body is not applied to input elements.
_variables.scss defines font-stack, but it is not in the materializecss documentation
_typography.scss applies font-stack to a few elements only: button, input, optgroup, select, textarea
_typography.scss applies font-family to html.

Effect: when overriding own font-family in body, it is inherited everywhere except the above elements, which will look different when the undocumented font-family has not been adjusted. This might be hard to spot and results in different looks on different operating systems and browsers.

Proposal: provide full support for setting font-family to groups of elements and document how to apply.

@roiLeo roiLeo added the css/sass For something that related to styling/view label Sep 29, 2021
@DanielRuf
Copy link

The font-family that is set in html body is not applied to input elements.
_variables.scss defines font-stack, but it is not in the materializecss documentation
_typography.scss applies font-stack to a few elements only: button, input, optgroup, select, textarea
_typography.scss applies font-family to html.

Just to understand this a bit better. Is the issue due to different settings applied to different parts? Because normally setting it once for html, body should set it for all elements and there should be only further overwrites for specific reasons.

@RamonvdW
Copy link
Author

RamonvdW commented Sep 30, 2021 via email

@LoganTann
Copy link

LoganTann commented Oct 15, 2021

Hello, by reading the code, setting the font in the body/html should correctly set your font-stack.
Can you please provide further information such as a CodePen (so we can quickly if we can reproduce this issue), which browser don't works (+ the Operating System) and the ones that works too ?

@LoganTann
Copy link

LoganTann commented Oct 15, 2021

After some investigation, I can see that some rules are overriding the font stack in the _global.css file for the button, input, optgroup, select and textarea tags

I think this was added to override the default browser settings. Thus, I don't know if we can consider it as a feature 🤔

@LoganTann
Copy link

By the way, there are still some unused commented code (https://github.com/materializecss/materialize/blob/main/sass/components/_global.scss#L25), should we remove it ?

@DanielRuf
Copy link

Do you mean this?

image

This is just some example code to push a footer to the bottom of a page @LoganTann.

I think we can safely remove this code since this is also a well-known and documented way to make footers the right way.

@LoganTann
Copy link

Proposal: provide full support for setting font-family to groups of elements and document how to apply.

Fine, so in order to fix this :

  • Document how to change the font stack
  • Remove the commented-out code above.

I'm adding the docs + first good issue tags

@LoganTann LoganTann added documentation Improvements or additions to documentation good first issue Good for newcomers labels Oct 16, 2021
DanielRuf added a commit that referenced this issue Oct 24, 2021
Fix #175 : Add a docs section on how to change the font stack
DyegoCosta pushed a commit to DyegoCosta/materialize that referenced this issue Jun 27, 2022
I'm still wondering why the font section have been deleted...
See : https://git.io/JK9is

Closes materializecss#175
DyegoCosta pushed a commit to DyegoCosta/materialize that referenced this issue Jun 27, 2022
I'm removing the most of the section about the Roboto Font by just
keeping the "how to change the font stack" part.

Fixes materializecss#175
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css/sass For something that related to styling/view documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants