Giter Club home page Giter Club logo

Comments (7)

jonathantneal avatar jonathantneal commented on August 16, 2024

The auto-scaling feature is wonderful. At least, it should be wonderful.

Unfortunately, it’s badly implemented, enough so that it can actively hurt desktop Safari users. In desktop Safari, the rem unit is dropped to 13px, regardless of the initial or current viewport size, and authors are given no way to know whether this is a deliberate user preference or not, nor are they given a way to specify a minimum font-size in the cases where it was not deliberate. It’s also a confusing pattern for authors, since additional font values like -apple-system-headline resolve to the same font-size as -apple-system-body in iOS and desktop Safari.

If there is a way around these issues in CSS, then I will probably be eager to add this feature, even if it only benefits iOS users.

from sanitize.css.

chrislachance avatar chrislachance commented on August 16, 2024

There is, but its a hack that targets iPad & iOS.

@supports(-webkit-touch-callout:default){ /* iOS and iPadOS, but not Desktop */
:where(:root){font: -apple-system-body}}
}

from sanitize.css.

chrislachance avatar chrislachance commented on August 16, 2024

Better yet, here's a Codepen with updated code. Desktop Safari is targeted instead to just manually reset to 16px as it does in its user-unsettable User Agent Stylesheet. If iOS were targeted instead, then custom font-family stuff needs to be set in 2 different :root areas, which is a pain to maintain. - https://codepen.io/chrislachance/pen/OJpmgrM

Seems like the heaviness of this solution may go against what the goals of Sanitize are, however, so I get it if you don't want to add to the library.

from sanitize.css.

jonathantneal avatar jonathantneal commented on August 16, 2024

Your work is incredible, @chrislachance.

I’m sad to present some more bad news. If I adjust the text size in iOS and then disable the setting, the text size adjustment is still applied. This feels actively harmful.

I noticed that it’s not just iOS Safari getting this wrong. I noticed that iOS Mail continued to use the disabled text adjustment.

If you have the time and availability, you could make the web better by filing a bug with Apple, and advocating for the change until it happens. Your only reward may be knowing it eventually does the right thing, and the esteem of your fellow developers, like myself, who knew nothing of this until you showed it to me.

from sanitize.css.

chrislachance avatar chrislachance commented on August 16, 2024

Interesting. Can you share a screenshot of the disabled setting? I must have missed that one.
I've already asked Safari iOS to consider fixing this for its browser officially a few days back. (Unless you have secret contacts at Apple :) )

from sanitize.css.

chrislachance avatar chrislachance commented on August 16, 2024

BTW, if you mean the setting shown in this image, it only allows for users to pick larger sizes.
It's not an enable/disable toggle (weird huh?)

from sanitize.css.

jonathantneal avatar jonathantneal commented on August 16, 2024

To answer your question, yes, I was incorrectly identifying the control as a toggle, and I agree that it’s a weird, unexpected user interface.

I’ve taken the issue to Twitter, in case there are other ideas. I want to know if users can adjust the text size in macOS, to test whether the 1rem fix is merely disabling the accessibility (similar to how it disables the accessibility in iOS).

https://twitter.com/jon_neal/status/1437917257108271107

from sanitize.css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.