这里是 Frontend Focus 的中文翻译项目,每周在 Dinosaur Rss 🦕 平台首发。
翻译及校对:richshaw2015,Yully Che
The Cicada Principle is the idea that when creating repetitive patterns, backgrounds, etc. using prime numbers can increase the appearance of organic randomness. Lea shows how she used a modern approach to this idea to format her code examples in a visually striking way.
来源:Lea Verou
A modern twist on the CSS Zen Garden idea of yesteryear where people submit their own manipulations of a concept using the most modern of CSS features. Here are the submissions so far with Vaporwave being my favorite. They all have a very “90s Web design renaissance” feel to them though.
来源:Stephanie Eckles et al.
Two of Google’s best known faces on the Chrome side of things give a twenty minute run through a whole bunch of new bits and pieces available in the DevTools in areas like performance monitoring, WebAssembly source mapping, and cookies.
来源:Paul Lewis and Surma (Google)
Adobe Flash passes off into the sunset later this year, and Ars Technica have taken a look back at its story. A nice bit of nostalgia.
You can now start up a new Codepen by visiting pen.new.
Got a flashlight to hand? This personal site takes an amusing unique approach to dark mode.
I like this: A curated list of whimsical websites that have a bit of fun and spark joy.
An interesting UX enhancement that involves saving the current scroll position in localstorage
before the user navigates away.
let sidebar = document.querySelector(".sidebar");
let top = localStorage.getItem("sidebar-scroll");
if (top !== null) {
sidebar.scrollTop = parseInt(top, 10);
}
window.addEventListener("beforeunload", () => {
localStorage.setItem("sidebar-scroll", sidebar.scrollTop);
});
来源:Chris Coyier / Hakim El Hattab
An interesting look at automating classes with Sass mixins and maps.
@mixin loop-mq {
@content;
@each $key, $value in $breakpoints {
@media (min-width: #{$value}) {
&\@#{$key} {
@content;
}
}
}
}
来源:Philip Zastrow
Logos often suit dark or light contexts and not the other, but you can swap them dynamically with a bit of CSS.
来源:Gift Egwuenu
It’s not just ads that get blocked but trackers too. Every site will have a different audience profile and a different likelihood of having its tracking blocked, so maybe it’s better to track requests behind the scenes or focus on other metrics instead.
来源:Marko Saric
prefers-contrast
媒体查询属性This upcoming media query works in a similar way to prefers-colour-scheme
, and is to be used to detect if the user has requested the system increase or decrease the amount of contrast between adjacent colors. This blog post walks through its design and implementation in Firefox.
来源:Zeke Medley (Mozilla)
Core Web Vitals is a set of metrics portraying three aspects of user experience: loading, interactivity and visual stability.
来源:Karolina Szczur
WebGL is pretty intimidating but this boils it down to the bare essentials. And if you want to go further, I still think this thorough guide is one of the best. Of course, you may see all of the boilerplate needed and just use Three.js instead, which is fine too! 😄
来源:Avik Das
来源:Christian Heilmann
Simple, monochrome, line art SVG icons covering lots of concepts from (mostly) computer and browser based concepts to arrows and weather.
来源:Paweł Kuna
If you don’t find it hip to be square, consider a cross between the square and the circle: the squircle.
来源:georgedoescode
Gatsby is an increasingly popular React-based site building framework and this new plugin brings it to WordPress. The idea is you can use WordPress as a headless CMS with Gatsby taking care of the front-end.
来源:Hashim Warren (Gatsby)
They also boast good ethics as there’s no tracking code involved.
来源:Nikita Karamov
A responsive frontend framework designed for quickly building dashboards and product pages. Uses Bootstrap-like classes, and is compatible with IE11.
来源:Halfmoon
A handy online tool to try out.
来源:Codsen ltd
I’m quite impressed how simple this is - it leans on the steps
directive to make the animation jerky enough to look like typing.
来源:CodePen demo
译者注:如需了解,请查看原文。
译者注:如需了解,请查看原文。
Copyright © 2015-2022 BY-NC-ND 4.0