Search
Playing With (Fake) Container Queries With watched-box & resizeasaurus
5.5.2020
Heydon’s <watched-box> is a damn fantastic tool. It’s a custom element that essentially does container queries by way of class names that get added to the box based on size breakpoints that are calculated with ResizeObserver. It’s like a cleaner version of what Philip...
Using Formik to Handle Forms in React
28.4.2020
There is no doubt that web forms play an integral role in our web site or applications. By default, they provide a useful set of elements and features — from legends and fieldsets to native validation and states — but they only get us so far when we start to consider the peculiarities of using...
Create a Responsive CSS Motion Path? Sure We Can!
15.4.2020
There was a discussion recently on the Animation at Work Slack: how could you make a CSS motion path responsive? What techniques would be work? This got me thinking.
A CSS motion path allows us to animate elements along custom user-defined paths. Those paths follow the same structure as SVG paths....
JavaScript Picture-in-Picture API
14.4.2020
As a huge fan of media on the web, I’m always excited about enhancements to how we can control our media. Maybe I get excited about simple things like the <video> tag and its associated elements and attributes because media on the web started with custom codecs, browser extensions,...
Thinking in Behaviors, Not Screen Sizes
11.4.2020
Chase McCoy wrote a nifty post about the “gap problem” when making a grid of items. His argument might be summarized like this: how should we space elements with margins in CSS? He notes that the gap property isn’t quite ready for prime time when it comes to using it with flexbox, like this:
.grid...
Why Do Some HTML Elements Become Deprecated?
2.4.2020
The internet has been around for a long while, and over time we’ve changed the way we think about web design. Many old techniques and ways of doing things have gotten phased out as newer and better alternatives have been created, and we say that they have been deprecated.
Deprecated. It’s a word...
Custom Elements v praxi
29.3.2020
Jak se něco dozvědět o nové technologii? Vyzkoušet ji v praxi! Mám za sebou už pár neseriózních pokusů s vlastními HTML značkami a v minulých dnech a týdnech jsem s jejich pomocí přepsal regulérní aplikaci webového klienta pro MPD, nazvaného CYP. Co jsem se při tom naučil a dozvěděl?
Creating a Pencil Effect in SVG
28.3.2020
Scott Turner, who has an entire blog "Exploring procedural generation and display of fantasy maps", gets into why vector graphics seems on these surface why it would be bad for the look of a pencil stroke:
Something like this pencil stroke would require many tens of thousands of different...
Auto-Growing Inputs & Textareas
25.3.2020
By default, <input> and <textarea> elements don't change size based on the content they contain. In fact, there isn't any simple HTML or CSS way to make them do that. Kinda funny, as that seems like a reasonable use-case. But of course, there are ways, my friend. There are always...
How to Create a “Skip to Content” Link
17.3.2020
Skip links are little internal navigation links that help users move around a page. It’s possible you’ve never actually seen one before because they’re often hidden from view and used as an accessibility enhancement that lets keyboard users and screen readers jump from the top of the page to...
What React Does (and Doesn’t Do)
5.3.2020
With a name as big as React, it's bound to cause some Stream-Crossing Confusion, as I like to call it. How do you center a <div> in React? Dave Ceddia:
React cares exactly zero about styling. Think of it as generating the barebones HTML. React will put elements on the page, but everything...
Listen to your web pages
16.2.2020
A clever idea from Tom Hicks combining MutationObserver (which can "observe" changes to elements like when their attributes, text, or children change) and the Web Audio API for creating sounds. Plop this code into the console on a page where you'd like to listen to essentially any DOM change...
Creating a Details Element That Opens But Never Closes
15.2.2020
The <details> and <summary> elements in HTML are useful for making content toggles for bits of text. By default, you see the <summary> element with a toggle triangle (▶︎) next to it. Click that to expand the rest of the text inside the <details> element.
But...
Collective #589
13.2.2020
Toward Responsive Elements * The wonderful sound of an atomic commit * OpenChakra * drop.lol * GitHub CLI beta
Collective #589 was written by Pedro Botelho and published on Codrops
Toward Responsive Elements
12.2.2020
Hot news from Brian Kardell, regarding what we've been referring to as "container queries", the most hotly requested feature in CSS:
There does seem to be some general agreement on at least one part of what I am going to call instead "Responsive Design for Components" and that is that flipping...
Custom Styling Form Inputs With Modern CSS Features
7.2.2020
It’s entirely possible to build custom checkboxes, radio buttons, and toggle switches these days, while staying semantic and accessible. We don’t even need a single line of JavaScript or extra HTML elements! It’s actually gotten easier lately than it has been in the past. Let’s take a look.
Here’s...
Full-Width Elements By Using Edge-to-Edge Grid
7.2.2020
If you have a limited-width container, say a centered column of text, "breaking out" of that to make a full-width element involves trickery. Perhaps the best trick is the one with left relative positioning and a negative left viewport-based margin. While it has it's caveats (e.g. requiring hidden...
Set Type on a Circle… with offset-path
28.1.2020
Here's some legit CSS trickery from yuanchuan. There is this CSS property offset-path. Once upon a time, it was called motion-path and then it was renamed. I sort of rolled my eyes at the time, because the property is so obviously for animating things along a path. But you don't have to use it...
What’s the Difference Between Width/Height in CSS and Width/Height HTML attributes?
24.1.2020
Some HTML elements accept width and height as attributes. Some do not. For example:
<!-- valid, works, is a good idea --<img width="500" height="400" src="..." alt="..."<iframe width="600" height="400" src="..."</iframe<svg width="20" height="20"</svg<!-- not valid...
3D Folding Layout Technique for HTML Elements
14.1.2020
A tutorial on an experimental 3D layout technique for HTML elements with endless possibilities.
3D Folding Layout Technique for HTML Elements was written by Daniel Velasquez and published on Codrops