For Your Convenience, This CSS Will Self-Destruct | Scott Jehl, Web Designer/Developer
Briefly

For Your Convenience, This CSS Will Self-Destruct | Scott Jehl, Web Designer/Developer
"As a web developer, I find that good performance, accessibility, and reliability is often acheived by playing defense against the many problems folks may encounter while using the web. The more I ask myself questions like, "what could go wrong here if JavaScript fails to fully load, or has a runtime error, or merely takes a while to load?," the more I find my sites are usable when those things inevitably happen."
"Along those lines, here's a little defensive pattern that I have used recently and quite enjoy. Let's say that a portion of your webpage is hidden when initially delivered, and revealed at a later time after it has loaded, perhaps even using an animation. There are a number of ways to implement this sort of pattern, and some particular brand-new ways are the ways that I'd recommend you consider trying first."
Good performance, accessibility, and reliability improve by anticipating failures and playing defense against common web issues. Hiding page elements with CSS (for example, using .pre-fade { opacity: 0; }) and then relying on JavaScript to reveal them creates a failure mode where content can remain inaccessible if JavaScript fails, errors, or loads slowly. Such patterns can work locally but fail for real users in varied environments. No non-essential visual effect justifies making content potentially unavailable to users for extended periods or permanently.
Read at Scottjehl
Unable to calculate read time
[
|
]