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

Issues with font changes and more in _base.scss #17

Open
Aetles opened this issue Dec 16, 2020 · 0 comments
Open

Issues with font changes and more in _base.scss #17

Aetles opened this issue Dec 16, 2020 · 0 comments

Comments

@Aetles
Copy link

Aetles commented Dec 16, 2020

The file assets/scss/partials/_base.scss contains this:

html {
  @apply antialiased;
  font-size: 15px;
  text-rendering: optimizeLegibility;

  @screen md {
    font-size: 18px;
  }
}

When I'm using this fine theme I'm removing this because it causes some unwanted and maybe unexpected issues with Tailwind and I just wanted to shine some light on it for others to see.

Tailwind uses the rem unit extensively and that means that all the spacing everywhere are affected by changes to font-size on html, since rem is by definition equal to the font-size on the root element. By default most browsers are using 16px as the base font-size if nothing else is set. If you look at the Default spacing scale in the Tailwind docs it assumes that 1 rem = 16px.

Skärmavbild 2020-12-16 kl  01 14 57@2x

So a change to the base font-size like this will make every type of spacing smaller on mobile (because of font-size: 15px; and larger on medium and up (because of font-size: 18px;). That makes it much harder to design with pixels in mind, in my experience, especially when it varies with the media query.

A completely different issue in this CSS is the use of antialiased which according to some is not recommended any more.

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

No branches or pull requests

1 participant