Skip to content

Instantly share code, notes, and snippets.

@clare-codes
Last active December 29, 2015 07:59
Show Gist options
  • Save clare-codes/7639811 to your computer and use it in GitHub Desktop.
Save clare-codes/7639811 to your computer and use it in GitHub Desktop.
Quick tip: Avoid using text-size-adjust: none;

Quick tip: Avoid using text-size-adjust: none;

text-size-adjust: none has been previously used in order to stop font size adjustment for text on mobile browsers, unfortunately this can lead to some desktop browsers being unable to zoom making it an accessibility concern. A better solution to this would be to specify text-size-adjust: 100% (to inflate text sizes at an exact proportion).

The bad way:

body {
	text-size-adjust: none;
}

The good way:

body {
	text-size-adjust: 100%;
}

This property is not standard and may need to be prefixed to work cross browser.

###Futher Reading [http://www.456bereastreet.com/archive/201011/beware_of_-webkit-text-size-adjustnone/] (http://www.456bereastreet.com/archive/201011/beware_of_-webkit-text-size-adjustnone/) [https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust] (https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust)

@grayghostvisuals
Copy link

@clarehyam
I'm trying to determine if this is an article more about how to avoid a webkit bug over creating something accessible (It's kind of 50/50 here). Vendor prefixes are on their way out as we speak which is why I say this.

Is there a way we can make this sound more like a best practice over how to avoid a bug? What do you think @davatron5000

Cheers 🍻

@clare-codes
Copy link
Author

@grayghostvisuals, Thank you so much for your comments :)

I've tried re-wording to make it a bit more like a best practice than addressing a specific bug and removed prefix references, but would really appreciate your thoughts.

@grayghostvisuals
Copy link

@clarehyman
I didn't catch that last line until this second round about it not being a standard. That part ruffles my feathers a bit because it is in fact vendor specific and not standardized. What part of the spec is this at currently? Do u think it will become a standard?

@clare-codes
Copy link
Author

@grayghostvisuals only added that in 2nd revision because I'd took out the prefix - so the code sample wouldn't work in any situation (and thought that should be clear). I can take it out? Unsure if it will ever become standardised. Apologies, I don't have any visibility on this. This was the link where I got the info from: https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust.

Only picked this topic as was in the list of suggested posts and thought I could quickly summarise the issue although if not useful or I've misunderstood the purpose please don't worry I can close this and leave to someone else.

@grayghostvisuals
Copy link

I think there's something still here to use for sure so it's not useless by any means. If you can keep this link up we'll come back to it. Thanks for submitting and lending a hand.

@clare-codes
Copy link
Author

Sure no problem, hope it is of use to someone :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment