JavaScript performance is bananas, a thread.
Let's write a function to sum the values from a the 'val' property of each element in an array:
function sum(arr) {
let acc = 0;
for (let i = 0; i < arr.length; i++) {
acc += arr[i].val;
}
return acc;
}
1/10
A thread about the future of color in CSS.
Why P3 colors will be the “new retina” that we will all have to support.
How we will write colors in CSS in 2022-2023.
WCAG 3 will use a new color contrast method called APCA (Advanced Perceptual Contrast Algorithm).
It's a big improvement over the current system but there are a lot of changes to get your head around.
🧵
Amaze! Being able to test diff screenreaders has never been easy. Most devs don't have the test machines or working knowledge of AT across platforms. Add Talkback for mobile testing -> take my 💰
🦮 OMG, there is a BrowserStack for assistive technology! Using https://t.co/fzP0lfUMHc you can test in many ATs without installing them or changing your OS settings.
https://t.co/g55hVSEw0w
"Daily" hints: How to mix HTML & WebGL w/ occlusion: https://t.co/kVSkTZUyrW
This would otherwise be hard, but it's trivial in r3f. Just drop a Html component into your scene. It transforms and occludes automatically!
Help me keeping these going: https://t.co/MLfpuZTFfJ 🍉🍴
🟣 CSS Quick Tip: min() and max()
Use these CSS functions to responsively adjust:
- element width
- border width
- padding
- margin
- ...and more!
Review the CSS comments in this @CodePen for more details:
https://t.co/EptxEmQYFd
"Boring avatars is a tiny JavaScript React library that generates custom, SVG-based, round avatars from any username and color palette."
https://t.co/xHi0dwZdyO
—
These avatars are anything but boring! 😍
📐Storybook Measure is coming to 6.3!
It shows you margin, padding, and dimensions of DOM elements when you hover on them.
That means you can spot check UI spacing in @storybookjs without loading devtools (heavy!).
👏 Big up to @winkerVSbecks
The <img> element now supports lazy-loading, async decoding and many other features: https://t.co/QcbvWLQfT7 I wrote about how to optimize UX & the Core Web Vitals with it.
Interested in learning how to mock API calls with @miragejs and Storybook?
Check out this great overview article by @hipsterbrown for a solid overview on you can do it in your own project!
https://t.co/OvZeHs1JBV