Search
Did You Know the Ordered List Element Has Start and Reversed Attributes?
24.3.2020
I sure didn't! Tomek Sułkowsi shows how we can reverse the numbering of ordered lists with a simple HTML attribute:
<ol reversed<liApple</li<liBanana</li<liPear</li</ol
CodePen Embed Fallback
And the start attribute can be added to begin the list at a number other...
Emojis as Favicons
24.3.2020
Lea Verou had a dang genius idea to use an emoji as a favicon. The idea only recently possible as browsers have started supporting SVG for favicons. Chuck an emoji inside an SVG <text element and use that as the favicon.
Now that all modern browsers support SVG favicons, here's how...
CSS :nth-of-class selector
23.3.2020
That's not a thing.
But it kinda is!
Bram covers how frustrating .bar:nth-child(2) is. It's not "select the second element of class .bar." It's "select the second element if it also has the class .bar." The good news? There is a real selector that does the former:
:nth-child(2 of .bar) { }
Safari...
CSS Can Influence Screenreaders
23.3.2020
Ben Myers covers some clear examples of where CSS totally changes what some screen readers announce. For example, some screenreader will see text-transform: uppercase; on a button label that says "Add" and read it like an abbreviation, "A.D.D."
These cases of CSS messing with our screenreader...
Flexible Repeating SVG Masks
22.3.2020
Tyler Gaw reminds us that mask-image can repeat, resize, and move just like background-image does, which is fun to combine and play with. I could see it being a fun option for an <hr, like Sara is doing.
CodePen Embed Fallback
Direct Link to Article — Permalink… Read article...
CSS2JS
20.3.2020
To add inline styles on an element in JSX, you have to do it in this object syntax, like:
<div style={{
fontSize: 16,
marginBottom: "1rem"
}}Content
</div
That might look a little weird to us folks who are so used to the CSS syntax, where it is font-size (not fontSize), margin-bottom...
Ethereum Baseline Protocol Code Now Available on GitHub
20.3.2020
Private systems are now available to all on the Ethereum blockchain, using the Baseline Protocol
What Does `playsinline` Mean in Web Video?
18.3.2020
I got myself confused about this the other day, went around searching for an answer and came up empty on finding something clear. The answer actually is quite clear and I feel a little silly for not knowing it.
With it in place, like this:
<video src="..." controls playsinline</video
Mobile...
Flexbox and absolute positioning
18.3.2020
Chen Hui Jing notes that when you absolutely position a flex item, it's no longer part of the flex layout. Except... it kinda is a little bit. If you make the child position: absolute; but don't apply any top/right/bottom/left properties, then flexbox alignment will still apply to it.
It's odd...
A Complete Guide to calc() in CSS
17.3.2020
CSS has a special calc() function for doing basic math. Here's an example:
.main-content {
/* Subtract 80px from 100vh */
height: calc(100vh - 80px);
}
In this guide, let's cover just about everything there is to know about this very useful function.
calc() is for values
The only place you...
Need Self-regulatory Code of Practice, but Exchanges Busy in USDT Manipulation: Crypto Kanoon
17.3.2020
One of the biggest crypto influencers in India, the pseudonymous Crypto Kanoon tweeted on Tuesday that after the industry won the battle against the RBI on March 04, there was a need for self-regulatory code of practice. However, he said, the exchanges were busy in customer acquisition strategies...
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...
How to Make Repeating Border Images
16.3.2020
I just saw this cool little site from Max Bittker: broider. You design an image on a 9-slice grid (except the middle part) and it will produce an image for you to use with border-image along with the CSS to copy and paste.
Check out my little design:
CodePen Embed Fallback
The areas of the image...
Bitcoin Cash IFP Debate: ABC Kicks Off Fundraiser, 3 Mining Pools Signal BCHN Support
15.3.2020
During the first week of March, there were prominent discussions concerning the recently announced infrastructure funding proposal (IFP). However, a number of crypto participants are focused on the market carnage and the possibility of a global recession. After the new full node project published...
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...
Careful with Nested `display: grid; height: 100%;`
11.3.2020
It's not every day you can feel CSS be slow at something. Reddit user jgbbrd discovered nesting grid containers that all have 100% height can cause many-seconds of rendering delay. Probably not something you'll ever have to worry about, but still, interesting. From the comments:
What a funny...
Sass !default and themeable design systems
11.3.2020
This is a great blog post from Brad Frost where he walks us through an interesting example. Let’s say we’re making a theme and we have some Sass like this:
.c-text-input {
background-color: $form-background-color;
padding: 10px
}
If the $form-background-color variable isn’t defined then...
Fluid Width Video
11.3.2020
IN A WORLD of responsive and fluid layouts on the web, ONE MEDIA TYPE stands in the way of perfect harmony: video. There are lots of ways in which video can be displayed on your site. You might be self-hosting the video and presenting it via the HTML5 <video tag. You might...
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;...
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...