这里是 Frontend Focus 的中文翻译项目,每周在 Dinosaur Rss 🦕 平台首发。
翻译及校对:richshaw2015,Yully Che
I don’t really hear the term “pixel perfection” as much as I used to, but the author says it still pops up enough. Here, he compares what this phrase really means today versus what it used to, and suggests how we should move beyond it.
来源:Ahmad Shadeed
Harris Schneiderman walks you through the process of analyzing a wireframe and making coding decisions to optimize for accessibility.
来源:Smashing Magazine
How CSS grids can solve responsive layout issues and enable you to create sites that flow with screen sizes without having to worry about breakpoints.
来源:Kevin Pennekamp
Compare coding style, bundle size and performance of 33 different ways to make a Web Component.
来源:div riots
A neat little tool to create a 3D book cover that lets you customize perspective, animation duration, thickness of the book, rotation on hover, URL, etc. then grab the CSS code. I remember when we used to have to pay for tools like this :-)
来源:Sebastien Castiel
A new dev channel build of version 85 of Edge is now live.
Google is taking a little longer to enable mobile-first indexing in search.
Julia Evans shares a comic on just how position: absolute
works.
If you’ve ever been baffled by z-index positioning, the example shared here is worth remembering. “things inside a stacking context are painted together, as a unit”
来源:Martin Robinson
A good half-hour look at how you can enhance type legibility, accessibility, and consistency across your UI.
来源:Apple Developer
inline-block
?Chris Coyier asked how folks use the inline-block
value. Here’s a run through some common answers, and some issues that may crop up.
来源:CSS Tricks
Yep, the latest version of Bootstrap (currently in alpha) does away with jQuery in favour of using vanilla JS. Here’s a few pointers on using it.
来源:Zoltán Szőgyényi
These mailto:
links are everywhere and yet browsers and operating systems don’t really make them easy to use.
来源:Adam Silver and Amy Hupe
The core approach here is dubbed ‘Fisher Price’ design - keeping things obvious and simple.
来源:Jonas Downey (Basecamp)
a {
color: #dfe5f3;
text-decoration: none;
background-image: linear-gradient(#222b40, #222b40), linear-gradient(
rgb(176, 251, 188),
rgb(176, 251, 188)
), linear-gradient(#feb2b2, #feb2b2);
background-size: 20px 2px, 100% 2px, 0 2px;
background-position: calc(20px * -1) 100%, 100% 100%, 0 100%;
background-repeat: no-repeat;
transition: background-size 2s linear, background-position 2s linear;
}
a:hover {
background-size: 20px 2px, 0 2px, 100% 2px;
background-position: calc(100% + 20px) 100%, 100% 100%, 0 100%;
}
来源:Nicky Meuleman
来源:Sarah Drasner
mailto:
和 tel:
链接的另一种概念实现Add this script to convert mailto:
and tel:
links into a modal that appears on click that gives the user a choice to open in Gmail, Outlook, copy the link, etc.
来源:Matteo Manzinello
Google Fonts is a hugely popular way to bring custom fonts on to Web sites but if you’re feeling uneasy about giving Google all that user data, consider this. (You could, of course, also host the fonts yourself.)
来源:FontCDN
Full explainer here but this basically uses CSS variables that are added to the <html> element and act as universal mixins.
.breakpoints-demo > * {
--xs-width: var(--media-xs) 100%;
--sm-width: var(--media-sm) 49%;
--md-width: var(--media-md) 32%;
--lg-width: var(--media-gte-lg) 24%;
width: var(--xs-width, var(--sm-width, var(--md-width, var(--lg-width))));
--sm-and-down-bg: var(--media-lte-sm) red;
--md-and-up-bg: var(--media-gte-md) green;
background: var(--sm-and-down-bg, var(--md-and-up-bg));
}
来源:PropJockey
Find yourself scrolling mindlessly through junk on social media? This Doom-inspired library may help. 😅
来源:Chris Johnson
Because what isn’t cake?
来源:Jhey Tompkins codepen
译者注:如需了解,请查看原文。
译者注:如需了解,请查看原文。
Copyright © 2015-2022 BY-NC-ND 4.0