Select Page

Category: global scope

Weekly Platform News: HTML Inspection in Search Console, Global Scope of Scripts, Babel env Adds defaults Query

In this week’s look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties aren’t computing hogs, variables defined at the top-level in JavaScript are global to other page scripts, and Babel env now supports the defaults query — plus all of last month’s news compiled into a single package for you. Easier HTML inspection in Google Search Console The URL Inspection tool in Google Search Console now includes useful controls for searching within and copying the HTML code of the crawled page. Note: The URL Inspection...

Read More

Regarding CSS’s Global Scope

html { font-family: Roboto, sans-serif; } With the except of some form elements, you’ve just set a font on every bit of text on a site! Nice! That’s probably what you were trying to do, because of the probably hundreds of elements all over your site, setting that font-family every time would be tedious and error-prone. CSS is global by nature. On purpose! I like how David Khourshid put it: You ever stop and think about why CSS has a global scope? Maybe we want to use consistent typography, colors, sizing, spacing, layout, transitions, etc. and have our websites & apps feel like one cohesive unit? Love the cascade, the cascade is your friend. And yet. The global nature of CSS is perhaps the most-pointed-at anti-feature of CSS. Some people really don’t like it. We all know it’s very easy to write a single CSS rule that has implications all over a site, breaking things you really didn’t want to break. Two CSS properties walk into a bar. A barstool in a completely different bar falls over. — Thomas Fuchs 🎄🕹💾 (@thomasfuchs) July 28, 2014 There are whole new categories of testing to assist with these problems. Scoped styles aren’t the only reason there is such interest and adoption in the landscape of tools that is CSS-in-JS, but it’s a big one. There are loads of sites that don’t...

Read More