A design system fixes accessibility once, if it's the only source

A design system fixes accessibility once, if it’s the only source

设计系统只有在成为唯一来源时,才能一次性解决无障碍问题

Do accessibility remediation long enough and you arrive at the same conclusion every time. Stop fixing instances. Fix the thing that generates them. The natural end of that logic is the design system. Fix the button component once, and every button in the product inherits the fix. One change, every instance. It’s the most leveraged accessibility work you can do. 当你进行足够长时间的无障碍修复工作后,每次都会得出同一个结论:停止修复单个实例,去修复生成这些实例的源头。这一逻辑的自然终点就是设计系统。修复一次按钮组件,产品中的每个按钮都会继承这个修复。一次修改,覆盖所有实例。这是你能做的最具杠杆效应的无障碍工作。

It also rests on an assumption that can quietly fail. “Fixed at the source” assumes there is one source. When you fix the component, you fix every instance that goes through the component. That’s the promise, and it’s real. But somewhere in the codebase there may be two or three buttons that don’t go through it. A div with a click handler someone wrote in a hurry. A one-off in a corner of the app the component never reached. A copy made before the component existed and was never migrated. 但这也建立在一个可能会悄然失效的假设之上。“在源头修复”假设只有一个源头。当你修复组件时,你修复了所有通过该组件的实例。这是承诺,也是事实。但在代码库的某个角落,可能存在两三个不通过该组件的按钮:一个有人匆忙写下的带有点击处理程序的 div;一个组件从未触及的应用角落里的“一次性”代码;或者一个在组件存在之前创建且从未迁移的副本。

The canonical component gets corrected. The hand-rolled copies don’t, because they were never using the source. So your fix at the source covers the instances that use it and misses the ones that bypass it. The re-audit passes on the pages built from the component and fails on the pages that reinvented it. Same fix, same product, different result, and nothing in the component diff tells you why. 规范组件得到了修正,但手写的副本却没有,因为它们从未引用过该源头。因此,你在源头的修复覆盖了使用它的实例,却遗漏了绕过它的实例。重新审计时,基于组件构建的页面通过了,而那些“重新发明轮子”的页面却失败了。同样的修复,同样的产品,结果却不同,而组件的差异对比(diff)中没有任何信息能告诉你原因。

The closing step isn’t diffing the component. It’s grepping the pattern. The real end of a source-level fix isn’t confirming the component is right. It’s searching the codebase for every place the pattern was reimplemented, and deciding, for each one, whether to fold it back into the component or fix it where it sits. A source-level fix isn’t done when the source is right. It’s done when nothing bypasses it. 收尾工作不是对比组件的差异,而是搜索代码模式(grep)。源头修复的真正终点不是确认组件本身正确,而是在代码库中搜索所有重新实现该模式的地方,并为每一个地方做出决定:是将其合并回组件,还是在原地修复。源头修复并不是在源头正确时就结束了,而是在没有任何东西绕过它时才算完成。

This is the real argument for design systems, and the real work of one. A design system is the honest answer to “fix the system, not the instance.” It’s the one place an accessible pattern can live so that using it is the default. But a design system isn’t a folder of accessible components. It’s a commitment that the accessible pattern is the canonical path, and the easiest one. Those two conditions carry all the weight. 这就是设计系统的真正意义所在,也是其真正的工作内容。设计系统是对“修复系统,而非修复实例”这一理念的诚实回应。它是无障碍模式唯一的栖息地,从而使使用它成为默认选择。但设计系统不仅仅是一个存放无障碍组件的文件夹,它是一种承诺:无障碍模式是规范路径,也是最简单的路径。这两个条件至关重要。

If the accessible menu is harder to adopt than hand-rolling a dropdown, people hand-roll the dropdown, and you are back to instances, now scattered across a codebase that looks like it has a design system. The component exists. It just isn’t the source. 如果使用无障碍菜单比手写一个下拉菜单更难,人们就会选择手写,你又回到了处理单个实例的老路上,而这些实例散落在看起来似乎拥有设计系统的代码库中。组件确实存在,但它并不是唯一的源头。

So it’s two disciplines, not one. Building the pattern accessibly is the part everyone pictures. It’s also the smaller part. Making it the single source is the work. That means making it the path of least resistance, so bypassing it is harder than adopting it. It means catching the reinventions in code review, before they become the copies nobody knows about. And it means, every so often, grepping for the pattern and folding the strays back in. An accessible component fixes every instance that uses it. The work is making sure every instance uses it. 因此,这是两门学科,而非一门。以无障碍方式构建模式是每个人都能想到的部分,但它也是较小的一部分。让它成为唯一源头才是真正的工作。这意味着要让它成为阻力最小的路径,使得绕过它比采用它更难。这意味着要在代码审查中捕捉到“重新发明轮子”的行为,在它们变成无人知晓的副本之前。这也意味着要不时地搜索该模式,并将那些“流浪”的代码合并回来。一个无障碍组件可以修复所有使用它的实例,而真正的工作是确保每一个实例都使用它。