这里是 Frontend Focus 的中文翻译项目,每周在 己思 平台首发。
翻译及校对:richshaw2015,Yully Che
:is()
and :where()
很快就来了Šime Vidas explains how these new CSS pseudo-classes can be used (for reducing repetition, and keeping specificity low respectively).
Current browser support for ‘is()’ via caniuse.com
来源:Web Platform News
A solid, thorough guide on all things CSS media queries, good as a primer, or worth revisiting for a refresher.
@media <media-type> and (media feature) {
/*...*/
}
来源:Polypane
This is one of the most popular of the ‘drop-in’ CSS animation libraries, and they’ve now moved to version 4. Significantly, among the changes is a prefix on classes.
来源:daniel eden
An exploration of how you can use CSS Grid, along with properties such as auto-fit
and auto-fill
, to produce some nifty looking image galleries.
来源:Ana Tudor
Whilst the legal action here is specifically to do with ebooks, it’s important to underline the excellent preservation work of the Internet Archive (which includes the Wayback Machine) and how hugely important it is to the long-term conservation of the web as a whole.
来源:Colin Dwyer (NPR)
A new CSS function for mixing two colors is in the works.
Version 8 of the popular HTML 5 Boilerplate template is now available. Here’s the related GitHub repo.
The recently released ‘ScrollTrigger’ GSAP plugin claims to ‘reinvent scroll-driven animations‘.
Oops. The Brave browser has been observed autocompleting to URLs it could profit from.
A second release candidate for Vivaldi 3.1 has been released.
Explaining the lifecycle of Service Workers in PWAs and how to update them as fast as possible.
来源:Felix Gerschau About
Ahmad looks at the key differences between these two layout options, and although there’s no right or wrong here, he recommends some use-cases for where you may want to use each.
来源:Ahmad Shadeed
An impressive CSS-only recreation of the Mad magazine fold-ins (where folding a printed page would reveal a hidden message in the artwork).
来源:Thomas Park
A few simple pointers to improve the High Contrast Mode experience for Windows users.
来源:Sarah Higley
You’ll need to see the demo to get it, but it’s a neat visual effect well suited for when you’ve got a variety of photos to illustrate a concept.
来源:Mary Lou
How to use CSS counters to customize the appearance of numbers in an ordered list.
div.list {
counter-reset: list-number -1;
}
来源:Supun Kavinda
Covers vh
, vw
, vmin
and vmax
.
来源:Asha Laxmi and Maria Antonietta Perna
:root {
--color-primary-h: 30;
--color-primary-s: 100%;
--color-primary-l: 50%;
}
/* desaturate the primary color */
.element {
background-color: hsl(
var(--color-primary-h),
calc(var(--color-primary-s) - 20%),
var(--color-primary-l)
);
}
来源:Jim Nielsen
This is an excellent demo showing how Grid can be used to create a responsive newspaper-style layout.
来源:Olivia Ng codepen
A bundle format for frontend applications that unify static sites, SPAs, server-side rendering (SSR), and server-side logic in a single format that’s easy to deploy.
来源:Frontend Application Bundles
A lightweight, advanced table plugin that can work alongside React, Angular, Vue, or, well, nothing. Check out some of the examples for more on how to use it. It uses Preact under the hood.
new Grid({
columns: ['Name', 'Email'],
data: [
['John', 'john@example.com'],
['Mike', 'mike@gmail.com']
]
}).render(document.getElementById('table'));
来源:Afshin Mehrabani
This is a small library that can embed a quote in an attractive format within the source context. Can also be used as a Chrome extension that saves to local storage.
<blockquote class="quoteback" darkmode="" data-title="Quote the web with Quotebacks" data-author="@ness_labs" cite="https://nesslabs.com/quotebacks">
The ethos behind Quotebacks is one of the reasons why I love the product. Yes, it’s a great addition to my thinking toolkit, allowing me to store quotes without polluting my note-taking and thinking system. But it’s also a tool which aims at making the Internet a more generous place. If you regularly write online, give it a try!
<footer>@ness_labs<cite> <a href="https://nesslabs.com/quotebacks">https://nesslabs.com/quotebacks</a></cite></footer>
</blockquote><script note="" src="https://cdn.jsdelivr.net/gh/Blogger-Peer-Review/quotebacks@1/quoteback.js"></script>
来源:Tom Critchlow and Toby Shorin
This feels like quite a natural way to navigate the over 100 ‘named’ CSS colors (like Gainsboro
, Firebrick
, and LawnGreen
).
来源:Mustafa Enes
Bills itself as ‘a beautiful replacement for JavaScript’s “alert
”’
来源:Tristan Edwards et al.
Use Visual Studio Code as a lightweight authoring and publishing tool for small to medium websites.
来源:Stefan Goessner
译者注:如需了解,请查看原文。
译者注:如需了解,请查看原文。
Copyright © 2015-2022 BY-NC-ND 4.0