Friday, November 22

CSS Tricks

CSS Tricks

Interactive Introduction to CSS Houdini

This is a great explanatory microsite by Sam Richard. CSS Houdini will let authors tap in to the actual CSS engine, finally allowing us to extend CSS, and do so at CSS speeds. Much like Service Workers are a low-level JavaScript API for the browser's cache, Houdini introduces low-level JavaScript APIs for the browser's render engines. What's important to know is that Houdini is broken up into these different parts, each of which will be implemented separately. We have an intro to the paint API here and a number of other articles that touch on it. Here's a very cool collection Dan Wilson put together of Houdini + Custom Properties. Direct Link to Article — PermalinkThe post Interactive Introduction to CSS Houdini appeared first on CSS-Tricks. Source: CSS-tricks.com
“Killing the URL”
CSS Tricks

“Killing the URL”

It was Safari who first started hiding the complete URL. Here's what CSS-Tricks looks like even when you're on an article page by default in Safari: The full URL path is hidden.You can only fix it (YES, FIX IT) by checking "Show full website address" in settings. Preferences > AdvancedWe've already damaged the sanctity of URLs in a way with URL shorteners. Thankfully, those are used less and less with social networks, like Twitter, not counting the URL toward the total tweet character count anymore. Now, Lily Hay Newman reports Chrome sees problems as well: "People have a really hard time understanding URLs," says Adrienne Porter Felt, Chrome's engineering manager. "They’re hard to read, it’s hard to know which part of them is supposed to be trusted, and in general I don’t think URLs a...
CSS Tricks

Shadow DOM in Ionic

Mike Hartington glows about how good and useful the Shadow DOM is: [Shadow DOM is] actually built on two simple ideas, isolation and location. Need to create a bit of DOM that is isolated from the global scope? Shadow DOM is here to help. Need to specify the exact location of a piece of DOM? Shadow DOMs scope API is what you need! It can be helpful to think of components that use Shadow DOM as modules for HTML. Markup and styles are isolated to their own DOM tree, and removed from the global context. Last time we talked about it around here, I showed how Twitter is using it for embedded tweets — which is a pretty awesome use case — and how it can fall back to an iframe. Mike says they polyfill it in unsupported situations. I suspect isolated styles is the primary selling point for any o...
CSS Tricks

Working With Events in React

Most of the behavior in an application revolves around events. User enters a value in the registration form? Event. User hits the submit button? Another event. Events are triggered a number of ways and we build applications to listen for them in order to do something else in response. You may already be super comfortable working with events based on your existing JavaScript experience. However, React has a distinct way of handling them. Rather than directly targeting DOM events, React wraps them in their own event wrapper. But we’ll get into that. Let’s go over how to create, add and listen for events in React. Creating Events We’ll start by creating a form that has an input and a button. An event will be triggered when a value is entered. The button is used to call a function which will ...
CSS Tricks

The Complete CSS Demo for OpenType Features

I'm very glad a guide for these features exists because we already know there are so many weird things that variable fonts can do — well done, Tunghsiao Liu! There are quite a few possible values for font-feature-settings, like, ya know: aalt, swsh, cswh, calt, hist, hlig, locl, rand, nalt, cv01-cv99, salt, subs, sups, titl, rvrn, liga, dlig, size, ornm, ccmp, kern, mark, mkmk, smcp, c2sc, pcap, c2pc, unic, cpsp, case, ital, ordn, lnum, onum, pnum, tnum, frac, afrc, dnom, numr, sinf, zero, mgrk, flac, dtls, ssty, ss01-ss20, smpl, trad, tnam, expt, hojo, nlck, jp78, jp83, jp90, jp04, hngl, ljmo, tjmo, vjmo, fwid, hwid, halt, twid, qwid, pwid, palt, pkna, ruby, hkna, vkna, rlig, init, medi, and fina ...to name a few. Direct Link to Article — PermalinkThe post The Complete CSS Demo for OpenT...
CSS Tricks

Helping a Beginner Understand Getting a Website Live

I got a great email from a fellow named Josh Long the other day. He is, in his words, "relatively new to web design" and was a bit stuck on the concept of getting a site live. I should say that I'm happy to get emails like this an I always read them, but I typically can't offer tech support over email. If I can respond at all, I normally point people to other community resources. In this case, it struck me what a perfect moment this is for Josh. He's a little confused, but he knows enough to be asking a lot of questions and sorting through all this stuff. I figured this was a wonderful opportunity to dig into his questions, hopefully helping him and just maybe helping others in a similar situation. Here's one of the original paragraphs Daniel sent me, completely unedited: I’m relatively ...
CSS Tricks

Level up your hosting. Get started on DigitalOcean with $100.

(This is a sponsored post.)Tired of slow, unreliable web hosting? See how easy it is to self-host your next project on DigitalOcean's cloud platform. Build and manage ultra-fast websites, blogs, and other static web pages using our user-friendly control panel or simple API, all with a 99.99% uptime SLA. Save time using our One-Click install apps for WordPress, Ghost and Discourse. Never worry about running out of storage space again with Spaces — highly scalable, affordable object storage. Sign up today with a free $100 credit for CSS-Tricks readers. Direct Link to Article — PermalinkThe post Level up your hosting. Get started on DigitalOcean with $100. appeared first on CSS-Tricks. Source: CSS-tricks.com
What do we call browser’s native development tools?
CSS Tricks

What do we call browser’s native development tools?

You know, that panel of tools that allows you to do stuff like inspect the DOM and see network requests. How do the companies that make them refer to them? Chrome calls them DevTools. Edge calls them DevTools. Firefox calls them Developer Tools. Safari calls it the Web Inspector. I think it's somewhat safe to generically refer to them as DevTools. Safari is the only browser that doesn't use that term, but I imagine even die-hard Safari users will know what you mean. The post What do we call browser’s native development tools? appeared first on CSS-Tricks. Source: CSS-tricks.com
CSS Tricks

Designing With Code

Wall Street Journal design director Matthew Ström on something near and dear to me: the link between code and design tools: We’re in the middle of a design tool renaissance. In the 8 years since Sketch 1.0 was released, there’s been a wave of competition among traditional design tools. And as the number of tools available to designers grows exponentially, ideas that were once considered fringe are finding a broader audience. One of these ideas will significantly change the way digital products are designed: integrating design and code at a deep level. Figma can update a React code base in real time; InVision, Abstract, and Zeplin have done away with design-developer handoff documents; Framer’s new Framer X can render interactive React components directly into its workspace. These examples...
Flutter: Google’s take on cross platform
CSS Tricks

Flutter: Google’s take on cross platform

Flutter is a mobile SDK that, at its core, is about empowering everyone to build beautiful mobile apps. Whether you come from the world of web development or native mobile development, Flutter makes it easier to create mobile apps in a familiar, simplified way, without ever giving up control to the framework. As of this writing, Google AdWords and Alibaba are both using Flutter in production. You can see more examples of who’s using Flutter (including the app I’ve worked on) on Flutter’s website on the showcase page. Right now, there’s a lot of buzz about Flutter. The question I see most often is, "Flutter or React Native...which one should I use?" Like all things in programming, its all about the tradeoffs you’re willing to make. I’m going to try to convince you that Flutter is the best ...
Render Caching for React
CSS Tricks

Render Caching for React

Server Side Rendering (SSR) is a very useful technique that makes web apps appear faster. The initial HTML is displayed before the JavaScript is parsed and, while the user is deciding what to tap on, our handlers are ready. Server side rendering in React requires additional work to setup and has server costs. Furthermore, if your server team cannot have JavaScript running on your servers, you are stuck. It significantly complicates the CDN setup especially if you have pages that require login and where the user’s information is managed. I want to walk through a new concept called Render Caching. This is a cool trick that can give users an instant performance boost just like that of SSR without having to resort to writing code on the server. What is Render Caching? The migration from stati...
CSS Tricks

New mobile Chrome feature would disable scripts on slow connections

This is a possible upcoming feature for mobile Chrome: If a Data Saver user is on a 2G-speed or slower network according to the NetInfo API, Chrome disables scripts and sends an intervention header on every resource request. Users are shown a UI at the bottom of the screen indicating the page has been modified to save data. Users can enable scripts on the page by tapping “Show original” in the UI.   And the people shout: progressive enhancement! Jeremy Keith: An excellent idea for people in low-bandwidth situations: automatically disable JavaScript. As long as the site is built with progressive enhancement, there’s no problem (and if not, the user is presented with the choice to enable scripts). Power to the people! This reminds me of the importance of a very useful bui...
Props and PropTypes in React
CSS Tricks, Web Tricks

Props and PropTypes in React

React encourages developers to build by breaking a UI up into components. This means there will always be a need to pass data from one component to another — more specifically, from parent to child component — since we’re stitching them together and they rely on one another. React calls the data passed between components props and we’re going to look into those in great detail. And, since we’re talking about props, any post on the topic would be incomplete without looking at PropTypes because they ensure that components are passing the right data needed for the job. With that, let’s unpack these essential but loaded terms together.   Props: The data being passed around Basically, props are what make React the tool that it is. React was designed to break things down into pie...
CSS Shape Editors
CSS Tricks

CSS Shape Editors

Firefox 62 is shipping out of beta on September 5th. The big notable thing for CSS developers is that it will now support the shape-outside property with polygon(), circle(), and ellipse(), joining Chrome and Safari.   What will be nice about the Firefox release (well, it's kinda already nice if you use something like Firefox Developer Edition which is already on 62), is that it has a shape editor built right into DevTools. Chrome supports shape-outside as well, but there is no native DevTools helper for working with them. Thankfully, Razvan Caliman has a Chrome Plugin that does a great job. (Razvan contributed to the Firefox version as well, I hear.)   I enjoy using shape-outside as it can add real visual interest to a page that isn't nearly overdone or trendy just ...
The Ecological Impact of Browser Diversity
CSS Tricks

The Ecological Impact of Browser Diversity

Early in my career when I worked at agencies and later at Microsoft on Edge, I heard the same lament over and over: "Argh, why doesn’t Edge just run on Blink? Then I would have access to ALL THE APIs I want to use and would only have to test in one browser!" Let me be clear: an Internet that runs only on Chrome’s engine, Blink, and its offspring, is not the paradise we like to imagine it to be. As a Google Developer Expert who has worked on Microsoft Edge, with Firefox, and with the W3C as an Invited Expert, I have some opinions (and a number of facts) to drop on this topic. Let’s get to it.   What is a browser, even? Let’s clear up some terminology. Popular browsers you know today include Google Chrome, Apple Safari, Mozilla Firefox, and Microsoft Edge, but in the past ...