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

Grids specify a font-family: why? #379

Closed
jconniff opened this issue Sep 15, 2014 · 15 comments
Closed

Grids specify a font-family: why? #379

jconniff opened this issue Sep 15, 2014 · 15 comments

Comments

@jconniff
Copy link
Contributor

I noticed another thing I have to override in Pure, that seems opinionated.
I can't think of a reason for this.

.pure-g [class *="pure-u"] {
font-family: sans-serif;
}
Suppose I specifically choose a font-family for my site with
body {
font-family: fontOfMyChoice;
}
anywhere I use grids, I'll see 'san-serif' instead of my font.

@lkraav
Copy link
Collaborator

lkraav commented Sep 15, 2014

Nothing to do with "opinionated". Read the docs http://purecss.io/grids/#using-grids-with-custom-fonts

@lkraav
Copy link
Collaborator

lkraav commented Oct 21, 2018

@redonkulus https://caniuse.com/#feat=flexbox shows ~95% usage. Wdyt, in celebration of year 2019, should the docs update the recommendation to .pure-g, .pure-g [class *= "pure-u"] { font-family: inherit; } (=== just roll w/ user/parent element font choices)?

AFAIU this font stack was necessary in the earlier days where inline-block might have been the prevalent display model, but w/ flexbox display where font stack has no effect, it just mostly gets in the way, having to override weird constructs lower in the element stack.

Maybe even combine an updated recommendation w/ @supports {}.

Your thoughts?

@KeiroD
Copy link
Contributor

KeiroD commented Nov 1, 2018

Hmm. I think this would be a good change, as reducing weird constructs would be good, in my book.

I'd go with this change. personally.

@lkraav
Copy link
Collaborator

lkraav commented Nov 1, 2018

@redonkulus your thoughts on re-open?

@redonkulus
Copy link
Contributor

@lkraav will this break anyone if we change it?

@lkraav
Copy link
Collaborator

lkraav commented Nov 6, 2018

will this break anyone if we change it?

Ain't that the million-dollar question :)

I made the change on my live sites already before posting this, and modern browsers didn't blink in any way. But people actually relying on inline-block rendering might have their columns pushed out. My hypothesis is that the casualty risk surface is fairly small, though.

Release 2.0.0 and call it "maybe backwards-compatible"?

@redonkulus
Copy link
Contributor

redonkulus commented Nov 17, 2018

@lkraav We could do that. If we go with a major release I would be interested to see if there are other breaking changes we would want to add. It would be good to roll them out in one release. Want to open an issue for 2.x and start adding currently open issues that would fall into that category?

@septatrix
Copy link
Contributor

I also just stumbled upon this. Based on the discussion it seems to me like a remnant of more complicated times.

Is the font override still on track for being removed?

@redonkulus
Copy link
Contributor

@lkraav we already did a major version bump so I guess that ship has sailed.

@septatrix I'm ok with removing the font family, it's not really needed anymore since flexbox and grid are available everywhere. Anyone that wanted it changed already would have done it in their project.

@septatrix
Copy link
Contributor

@septatrix I'm ok with removing the font family, it's not really needed anymore since flexbox and grid are available everywhere. Anyone that wanted it changed already would have done it in their project.

Should I create a PR then or would you like to do it? I assume the codebase is simple enough for me to find it :D

@redonkulus
Copy link
Contributor

redonkulus commented Oct 20, 2022

@septatrix yes please do! You can switch it to inherit.

Also please go into the site/ directory and run npm run start to make sure your change looks ok on the docs site and especially the "Grids" page.

@septatrix
Copy link
Contributor

Any advantage of using inherit instead of just removing the font-family declaration?

@redonkulus
Copy link
Contributor

I'm with with removing it too if that works.

@septatrix
Copy link
Contributor

Looking into the source it seems like the hack is still used for IE10/IE11 which are still supported.

https://github.com/pure-css/pure/blob/master/src/grids/css/grids-core.css#L33-L38

They theoretically support flexbox but they seem to suffer from a few potential issues, see the respective tab in caniuse: https://caniuse.com/flexbox

So while in my opinion no one today should go out of their way to support these browsers as they are officially unsupported as of this year (yay!) I am not sure if this should be done without a major version increase...

@redonkulus
Copy link
Contributor

Good point about the IE 10/11 support. We can just remove support for those browsers since they are EOL'd and release 3.x.

septatrix added a commit to septatrix/pure that referenced this issue Oct 23, 2022
Setting font-family and letter spacing was required for IE
and some other ancient browsers.
These are no longer supported, thus we can remove the hacks.
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

6 participants