Skip to content

Conversation

@adamwathan
Copy link
Member

In 0.x, a lot of different utilities were grouped under the textStyle module and so if a variant needed to be enabled for any of those utilities, it had to be enabled for all of them.

Now that the textStyle module has been split into fontStyle, textTransform, textDecoration, and fontSmoothing, we can control which variants to generate at a finer level.

This PR changes things so that only the textDecoration plugin has hover and focus variants enabled by default, as the underline and no-underline classes were the primary motivation for enabling those variants to begin with.

@benface
Copy link
Contributor

benface commented Mar 1, 2019

Isn't it common enough to italicize/unitalicize text on hover?

@adamwathan
Copy link
Member Author

Is it? I've never done it but if others do it often I'm cool with re-enabling.

@benface
Copy link
Contributor

benface commented Mar 2, 2019

I’ve seen it, but not often no, and I guess if you don’t include it for font-weight I wouldn’t include it for font-style by default either.

@adamwathan
Copy link
Member Author

We do include it for font-weight 😬

@benface
Copy link
Contributor

benface commented Mar 2, 2019

Oh haha. Hmm, what is it, 10 new classes?

@adamwathan
Copy link
Member Author

I think 20. It pains me to add hover:not-italic when I doubt anyone has ever used not-italic period, haha...

@adamwathan adamwathan merged commit ce48a4c into next Mar 2, 2019
@adamwathan
Copy link
Member Author

Gonna merge as-is for now, can re-enable it in 1.0.1 if necessary but 1.0 is my last chance to disable 😄

@hacknug
Copy link
Contributor

hacknug commented Mar 3, 2019

I've worked on some projects where the designers wanted to italicize links on hover. Imho it's a bad idea because things can get jumpy so I always try to use absolutely-positioned pseudo-elements for that, which translates to me never needing these utilities.

Did anyone ever needed this (fontSmoothing: ['responsive']) though? I always set it once on the body element and forget about it.

@adamwathan
Copy link
Member Author

Did anyone ever needed this (fontSmoothing: ['responsive']) though? I always set it once on the body element and forget about it.

The only reason I decided to keep that one enabled is because I think the recommendation is to use subpixel-antialiasing on light backgrounds, and regular antialiasing on dark backgrounds:

http://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/

So it seems reasonable to keep the responsive versions in case you change the background/text color responsively and need to adjust the font smoothing to suit 👍🏻

@hacknug
Copy link
Contributor

hacknug commented Mar 3, 2019

Yeah, I remember you mentioned that on Discord. Thanks for the link!

@adamwathan adamwathan deleted the disable-text-style-variants branch May 13, 2019 14:00
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.

4 participants