Search
Stop Using “Dropdown”
16.3.2020
Adrian Roselli notes that it might actually mean:
A <select> menu
An ARIA Listbox, Combobox, Menu, or Disclosure Widget
An input with a <datalist>
An input with autocomplete
A <details><summary> block
An accordion
Flyout navigation
In my own usage, I tend to mean...
Using the HTML title attribute
15.3.2020
Steve Faulkner:
User groups not well served by use of the title attribute
• Mobile phone users.• Keyboard only users.• Screen magnifier users.• Screen reader users.• Users with fine motor skill impairments.• Users with cognitive impairments.
Sounds like in 2020, the only useful thing the title...
Block Links Are a Pain (and Maybe Just a Bad Idea)
10.3.2020
As we noted in our complete guide, you can put an <a href=""> link around whatever chunks of HTML you like. Let's call that a "block link." Like you are wanting to link up an entire "Card" of content because it makes a big clickable target.
<a href="/article/"<!-- display: block;...
Negative Margins
9.3.2020
PPK digs into the subject, which he found woefully undercovered in web tech documentation. Our entry doesn't mention them at all, which I'll aim to fix.
Agree on this situation:
This is by far the most common use case for negative margins. You give a container a padding so that its contents have...
Adventures in CSS Semi-Transparency Land
9.3.2020
Recently, I was asked to make some tweaks to a landing page and, among the things I found in the code, there were two semitransparent overlays — both with the same RGB values for the background-color — on top of an image. Something like this:
<img src='myImage.jpg'/>
<div...
What to Use Instead of Number Inputs
6.3.2020
You might reach for <input type="number> when you're, you know, trying to collect a number in a form. But it's got all sorts of issues. For one, sometimes what you want kinda looks like a number, but isn't one (like how a credit card number has spaces), because it's really just a string...
The Slideout Footer
5.3.2020
A fascinating new site called The Markup just launched. Tagline: Big Tech Is Watching You. We’re Watching Big Tech. Great work from Upstatement. The content looks amazing, but of course, around here we're always interested in the design and tech as well. There is loads to adore, from the clean...
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...
Considerations for Creating a Card Component
2.3.2020
Here's a Card component in React:
const Card = props ={
return(
<div className="card"<h2{props.title}</h2<p{props.content}</p</div)
}
It might be pretty useful! If you end up using this thing hundreds of times, now you have the ability to refactor a little bit of HTML...
Unfortunately, clip-path: path() is Still a No-Go
2.3.2020
I was extremely excited when I first heard that clip-path: path() was coming to Firefox. Just imagine being able to easily code a breathing box like the one below with just one HTML element and very little CSS without needing SVG or a huge list of points inside the polygon function!
Chris...
Collective #594
2.3.2020
Vue.js: The Documentary * Negative margins in CSS * Rome * Beastnotes * HTML: The Inaccessible Parts
Collective #594 was written by Pedro Botelho and published on Codrops
HTML: The Inaccessible Parts
29.2.2020
<input type="number", <input type="date", <input type="search", <select multiple, <progress, <meter, <dialog, <details<summary, <video, <div onclick, <div aria-label, <a href<divBlock Links</div</a, aria-controls...
When CSS Blocks
28.2.2020
Tim Kadlec:
One particular pattern [for loading non-critical CSS] I’ve seen is the preload/polyfill pattern. With this approach, you load any stylesheets as preloads instead, and then use their onload events to change them back to a stylesheet once the browser has them ready.
So you're...
Chameleonic Header
26.2.2020
Nice demo from Sebastiano Guerriero. When a fixed-position header moves from overlapping differently-colored backgrounds, the colors flop out to be appropriate for that background. Sebastiano's technique is very clever, involving multiple copies of the header within each section (where the copies...
Inspiring high school students with HTML and CSS
21.2.2020
Here’s a heartwarming post from Stephanie Stimac on her experience teaching kids the very basics of web development:
[...] the response from that class of high school students delighted me and grounded me in a way I haven't experienced before. What I view as a simple code was absolute magic...
Footnote Characters
20.2.2020
They are special superset numbers that are sometimes perfect for footnotes. Here they are:
¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹
I generally prefer to superscript the number myself, like:
<pThis next word<sup1</suphas a footnote.</p
You'd probably add an anchor link around that as well to link to an...
Same HTML, Different CSS
19.2.2020
Ahmad Shadeed covers the idea of a card component that has a fixed set of semantic HTML with some BEMy classes on it. There is a title, author, image, and tags. Then he redesigns the card into five totally different designs without touching any of the HTML just the CSS.
If this is an ah-ha moment...
A Complete Guide to Data Attributes
18.2.2020
Everything you ever wanted to know about data attributes in HTML, CSS, and JavaScript.
The post A Complete Guide to Data Attributes appeared first on CSS-Tricks
Moving from Vanilla JavaScript to a Reusable Vue Component
17.2.2020
I recently wrote an article explaining how you can create a countdown timer using HTML, CSS and JavaScript. Now, let’s look at how we can make that a reusable component by porting it into Vue using basic features that the framework provides.
Why do this...
Lazy Object Initialization
17.2.2020
The Firefox DevTools underlying code, which is written with JavaScript and HTML, is a complex application. Due to the complexity and amount of work going on, the DevTools team has done everything they can to load as little as possible. Furthermore the team has a system of lazily importing...