Liked https://thanaverage.xyz/
Than Average
Imagine you are in a room with 100 strangers,
Imagine they're similar to your peers and neighbours.
Based solely on your own instinct, perceptions,
and self-reflection, answer the following questions.
ThanAverage is a small unscientific investigation into how we value and compare ourselves to each other.
Built badly by Fred Wordie
Oh No
than average?
of participants also think they than average.
Liked https://thanaverage.xyz/
Than Average
Imagine you are in a room with 100 strangers,
Imagine they're similar to your peers and neighbours.
Based solely on your own instinct, perceptions,
and self-reflection, answer the following questions.
ThanAverage is a small unscientific investigation into how we value and compare ourselves to each other.
Built badly by Fred Wordie
Oh No
than average?
of participants also think they than average.
Liked https://twitter.com/SystemErrorKaye/status/1390607781309423617
JavaScript is not available.
I hear pictures aren't being cropped anymore.. Check out this neat mountain range. pic.twitter.com/PUUkrOrMVt
— Kaye (@SystemErrorKaye) May 7, 2021
Liked https://twitter.com/momodraws/status/1391670485054803971
JavaScript is not available.
5 years ago this week I moved from Dundee, Scotland to Porto, Portugal. I miss my Friday morning bacon roll and Irn Bru but hey all in all I'm pretty happy going somewhere possible to get an actual tan every now and then
— Momo (@momodraws) May 10, 2021
Liked https://craftcms.com/accessibility/custom-focus-indicators-with-css-variables
Custom Focus Indicators with CSS Variables
We’ve been working to improve focus styles within Craft’s control panel lately, and will be sharing what we’re learning along the way. Here’s the third and final post of a three-part series on visible focus indicators.
This post will present a method of styling an offset outline type focus indicator using box-shadow
and CSS variables.
This method will meet the following criteria:
Skip to the demo of the final result or read on for a walkthrough of how this was achieved.
There are many ways to add an outline around an element with CSS. The simplest ways are probably using outline
or border
, but box-shadow
is often used to style focus indicators. It's a bit hacky, but using box-shadow
currently offers several benefits that often make it the preferred method of adding an outline.
outline
#
The outline
property is used for default focus indicators in browsers. It offers customizability in color, style, width, and offset (and radius in Firefox). outline
isn't usually used for styling, so there's less chance of styling conflicts.
This is the most sensible property to use to add outline styles, as long as the styling limitations are acceptable. For one thing, it isn't possible to create a focus outline with multiple colors. Additionally, the outline's shape won't necessarily match the element, which might look a little strange in some cases. For example, a round button will still have a square outline.
border
offers customizability in color, style, width, and radius.
As with outline
, multiple colors can't be used. The main drawback to using border
is that it takes up space, which means the element might be misaligned, or shift when it's focused.
pseudo-elements #
It would be possible to apply multiple outlines or borders on an element by styling their pseudo-elements (e.g. :before
and :after
). Unfortunately, not all focusable elements can have pseudo-elements, so this is not a reliable method.
box-shadow
#
box-shadow
is not the most obvious method of applying an outline style, but it has several benefits: it doesn't take up space, it matches the element's shape, and it can take multiple colors.
There isn't a way to set the distance between an element and its box-shadow, but it can be faked by adding a box-shadow of the same color as the background the element is on. CSS variables make this easier to accomplish.
We'll start by setting the initial values for the focus ring color and the background color.
:root {
--focus-ring-color: #0e44af;
--background-color: #fff;
}
Next, since we'll be adding our own focus styles with box-shadow
, we'll want to hide the browser's default outline
focus style. Instead of completely removing the outline by setting outline: none
, we'll set outline-color: transparent
. This will hide the outline while ensuring it's still visible in Windows high contrast mode.
Sarah Higley has an excellent blog post with this and other tips on Windows high contrast mode.
:focus {
outline-color: transparent;
}
We're also going to set the outline-style
to solid
. This is to ensure the default browser focus style in Edge, which has 2 colors, doesn't show.
:focus {
outline-color: transparent;
outline-style: solid;
}
Now we'll add our box-shadow
outline. This style leaves a gap around the focus element with the same color as the last set background color, and a focus ring with the last set focus ring color.
As long as the focus ring color has sufficient contrast against the background color, this will meet the focus visible success criteria.
:focus {
outline-style: solid;
outline-color: transparent;
box-shadow: 0 0 0 2px var(--background-color),
0 0 0 5px var(--focus-ring-color);
}
Finally, we'll add some different background colors. The box-shadow's gap color will always match the focused element's background color since we're setting the background color by modifying the --background-color
CSS variable.
.bg-color {
background-color: var(--background-color);
}
.bg-color--vanilla {
--background-color: #fff8e9;
}
.bg-color--strawberry {
--background-color: #ffeae8;
}
.bg-color--chocolate {
--background-color: #ecdad4;
}
Result #
Here's a CodePen demo with the final result! You can test out the focus styles by tabbing through the buttons.
Liked https://werd.io/2021/turning-off-syndication-to-twitter-at-least
Turning off syndication to Twitter, at least for today. If you're reading this, it's via my indieweb feed on my Known site, or on Micro.blog.
Liked https://i.redd.it/sclh6jy3m3l61.gif
Liked 🔥 Look closely, that is not a spider. The spider-tailed horned viper uses the tip of its tail to lure birds. on Reddit
Liked https://www.youtube.com/watch?v=woE0ZJUzbsY
Rabbit eating whole cranberries
Liked [Haiku] Rabbit eating whole cranberries on Reddit
Liked https://i.redd.it/623zwkowwxi61.jpg
Liked Hayloft [1410 x 1000] Ukraine on Reddit