USWDS Futures LabIndependent research and comparison pilot

Documentation

Implementation: logical properties for RTL

CSS

.usa-alert {
  border-left: 0 !important;
  border-right: 0 !important;
  border-inline-start: 8px solid var(--fx-info-edge) !important;
  text-align: start;
}
.usa-alert--warning { border-inline-start-color: var(--fx-warn-edge) !important; }
.usa-alert--error { border-inline-start-color: var(--fx-error-edge) !important; }
.usa-accordion__button,
.usa-banner__button,
.usa-banner__header-text,
.usa-banner__header-action { text-align: start; }

border-inline-start resolves to border-left in ltr and border-right in rtl. The physical border-left/border-right declarations are removed so the two rules cannot disagree.

Direction and language

site/assets/fixture.js sets dir from ?dir=rtl and only sets lang="ar" when explicitly requested with ?lang=ar. The banner fixture includes:

<p lang="ar" dir="rtl">معلومات الخدمة …</p>

The inline lang and dir keep the sample from changing the language of the surrounding English page. Do not set dir="rtl" on an English page and call that localization.

How to test

What a real contribution would need

Known gaps

Back to experiments · Source lock