-
Notifications
You must be signed in to change notification settings - Fork 0
Description
原文地址:https://defensivecss.dev/articles/intro-defensive-css/
一句话总结
本文作者是前端兼设计师 Ahmad(之前有解读过他的《The Guide To Responsive Design In 2023 and Beyond》),主要介绍 CSS 防御性编程(Defensive Programming)—— 防御性设计 Defensive design 在 CSS 上的体现。文章内容不多,通过几个示例,让前端以及设计师了解看似完美设计和实现,可能会在边界情况下出现各种问题,从而引起重视。
原文划重点
Back in December 2021, I wrote an article titled Defensive CSS. I used that term because that's really what is it about. I wanted a term that communicates the concept of writing CSS that prevents unexpected layout behaviors, or at least, reduces them.
作者在 2021 年底的时候已经写过一篇介绍防御性 CSS 编程的文章,提出了 “防御性 CSS” 这一概念。
It turned out that defensive CSS doesn't only apply to CSS, but UI design as well. As a designer, you need to either work on visual variations of a component with all the possible use-cases or at least communicate them clearly with the development team.
防御性设计的实现不仅需要 CSS,还需要设计师。设计师需要将组件各种情况下的视觉都设计好,最起码让开发者了解。
In this introduction article, I will shed the light on why it's important to design and write CSS defensively, and how we can take it from there.
在这篇文章中,主要介绍防御性设计、防御性 CSS 编程以及开发者应该从何开始。