swap
attribute to checkbox inputs. Growth has been years within the making, however Safari not too long ago pushed the matter by releasing help for the attribute — in addition to new pseudo-elements for styling hooks — in Safari Know-how Preview 185 and Safari 17.4. Daniel Yuschick walks us by a primary impression of swap controls and discusses present and ongoing issues that must be explored additional earlier than it’s prepared for prime time.
The online isn’t any stranger to taking HTML parts and remodeling them to look, act, and really feel like one thing fully completely different. A standard instance of that is the swap, or toggle, part. We’d disguise a checkbox beneath a number of layers of types, outline the ARIA position as “swap,” after which ship. Nevertheless, this strategy posed sure usability points round indeterminate states and all the time felt fairly icky. In any case, because the saying goes, one of the best ARIA isn’t any ARIA.
Nicely, there may be new hope for a local HTML swap to catch on.
Safari Know-how Preview (TP) 185 and Safari 17.4 launched with an under-the-radar characteristic, a native HTML swap management. It evolves from the hidden-checkbox strategy and goals to make the accessibility and usefulness of the management extra constant.