Search
Faking env() to Use it Now
18.4.2019
There is already an env() function in CSS, but it kinda came out of nowhere as an Apple thing for dealing with "The Notch" but it has made it's way to be a draft spec. The point will be for UAs or authors to declare variables that cannot be changed. Global const for CSS, sorta.
That spec doesn't...
Creating Reusable Base Classes in TypeScript with a Real-Life Example
18.4.2019
Hey CSS-Tricksters! Bryan Hughes was kind enough to take a concept from an existing post he published on converting to TypeScript and take it a few couple steps further in this post to elaborate on creating reusable base classes. While this post doesn’t require reading the other one, it’s certainly...
An Event Apart Boston is Coming. Save Now!
18.4.2019
(This is a sponsored post.)
An Event Apart Boston is almost here! We're talking, like, less than a month away. If you've been holding off from registering, this might be your last chance because time and seating are both limited. Besides, we're talking about three days of pure knowledge-dropping...
Clever code
17.4.2019
This week, Chris Ferdinandi examined a clever JavaScript snippet, one that's written creatively with new syntax features, but is perhaps less readable and performant. It's a quick read, but his callout of our industry's fixation on cleverness is worth... calling out:
...we’ve become obsessed as...
The Power of Named Transitions in Vue
16.4.2019
Vue offers several ways to control how an element or component visually appears when inserted into the DOM. Examples can be fading in, sliding in, or other visual effects. Almost all of this functionality is based around a single component: the transition component.
A simple example of this is with...
A Website is a Car and Not a Book
15.4.2019
I’ve been wondering for a good long while why it feels like web design and development isn’t respected as much as native app development= and why the front-end role in many organizations is seen as a nice-to-have rather than a vital part of the business. Why is it so hard to see that this gig...
Simulating Mouse Movement
15.4.2019
If you've ever had to display an interactive animation during a live talk or a class, then you may know that it's not always easy to interact with your slides and while talking.
This happened to me when I needed to show this particles demo to my students. I didn't want to have to stay next to...
Using the Web Speech API for Multilingual Translations
12.4.2019
Since the early days of science fiction, we have fantasized about machines that talk to us. Today it is commonplace. Even so, the technology for making websites talk is still pretty new.
We can make our pages on the web talk using the SpeechSynthesis part of the Web Speech API. This is still...
Inline SVG… Cached
12.4.2019
I wrote that using inline <svg> icons makes for the best icon system. I still think that's true. It's the easiest possible way to drop an icon onto a page. No network request, perfectly styleable.
But inlining code has some drawbacks, one of which is that it doesn't take advantage...
Accessibility Events
11.4.2019
“There isn't some way to know when—…?”
There is always a pause here. The client knows what they're asking, and I know what they're asking, but putting it into words—saying it out loud—turns unexpectedly difficult.
In the moments before the asking, it was a purely technical question—no different...
Edge Goes Chromium: What Does it Mean for Front-End Developers?
11.4.2019
In December 2018, Microsoft announced that Edge would adopt Chromium, the open source project that powers Google Chrome. Many within the industry reacted with sadness at the loss of browser diversity. Personally, I was jubilant. An official release date has yet to be announced, but it will be...
Get a CSS Custom Property Value with JavaScript
11.4.2019
Here’s a neat trick from Andy Bell where he uses CSS Custom Properties to check if a particular CSS feature is supported by using JavaScript.
Basically, he's using the ability CSS has to check for browser support on a particular property, setting a custom property that returns a value of either...
While solving for collaboration, we built a product that our own teams love and use everyday!
11.4.2019
(This is a sponsored post.)
Flock is a messaging and collaboration tool built for both designers and developers. With close-to-zero setup, it brings together all your team’s conversations, appointments, and files in one place, helping you spend more time on what you are best at — building...
Using “box shadows” and clip-path together
11.4.2019
Let's do a little step-by-step of a situation where you can't quite do what seems to make sense, but you can still get it done with CSS trickery. In this case, it'll be applying a shadow to a shape.
You make a box
.tag {
background: #FB8C00;
color: #222;
font: bold 32px system-ui;
padding:...
Under-Engineered Toggles
10.4.2019
Toggles. Switches. Whatever you want to call them, they've been with us for some time and have been a dominant a staple for many form interfaces. They're even baked right into many CSS frameworks, including Bootstrap and Foundation.
It's easy to think of them in binary terms: on and off. Off...
In Defense of the Ternary Statement
10.4.2019
Some months ago I was on Hacker News (as one does) and I ran across a (now deleted) article about not using if statements. If you’re new to this idea (like I was), you’re in a for a real treat. Just search for "if statements" on Hacker News. You'll get articles proposing that you might not need...
The Serif Tax
9.4.2019
Fonts are vector. Vector art with more points makes for larger files than vector art with fewer points. Custom fonts are downloaded. So, fonts with less points in their vector art are smaller. That's the theory anyway. Shall we see if there is any merit to it?
Open Sans (top) and Garamond...
Using a Mixin to Take the Math out of Responsive Font Sizes
9.4.2019
Responsive Font Size (RFS) is an engine that automatically calculates and updates the font-size property on elements based on the dimensions of the browser viewport.
If you’re thinking that sounds familiar, that’s because there is a slew of tools out there that offer various approaches for fluid...
Native Lazy Loading
9.4.2019
IntersectionObserver has made lazy loading a lot easier and more efficient than it used to be, but to do it really right you still gotta remove the src and such, which is cumbersome. It's definitely not as easy as:
<img src="celebration.jpg" loading="lazy" alt="..." />
Addy Osmani says...
Testing for Visual Regressions with Percy
8.4.2019
It’s a Herculean task to test