Urgent.News

What's breaking now, across thousands of outlets.

Tech

Alloy CSS abre diálogos y menús sin una línea de JavaScript

Un diálogo modal, un menú desplegable con un listado de fechas y una pestaña que filtra facturas vencidas. Los tres se abren en la demo de Alloy CSS sin que el navegador corra una sola línea de JavaScript ( fuente ). Eso es Alloy CSS sin JavaScript en estado puro: componentes de interfaz que hoy suelen depender de un framework, resueltos con HTML y CSS nada más. La demo se llama Ledger, un panel…

Alloy CSS, a CSS framework, demonstrates how to create modals, dropdown menus, and tabs without any JavaScript by showcasing its capabilities through a fictional billing panel called Ledger. This demo, named Ledger, presents 24 invoices from the past 90 days, with three overdue totaling $4,860 and two drafts. The panel includes three essential components that typically require JavaScript: a modal for creating a new invoice, a dropdown to choose a date range, and a row of tabs for filtering by status.

All these interactions are achieved through pure HTML and CSS, without relying on JavaScript. The key to this is the use of web standards that have been available for years, such as attributes like popover, the dialog element, and CSS pseudo-classes like :checked or :target. Alloy CSS simply packages these building blocks into ready-to-use components.

The Ledger demo is a demonstration of progressive enhancement, where a semantic HTML document functions initially, with CSS adding visual behavior, and JavaScript added optionally on top. This approach is beneficial for internal platforms, where each JavaScript dependency adds maintenance overhead. It reduces the need for auditing and security reviews, as well as improving page load speed, especially on slow corporate networks or older hardware.

However, the demo has limitations in terms of accessibility. When multiple invoices are selected, a "Selected invoices" panel appears, but this change is purely visual and not announced to screen readers. This requires additional ARIA markup to ensure screen reader users are informed of the change. While Alloy CSS doesn't handle this aspect, it does provide a clear path for developers to include accessibility features manually if needed.

Alloy CSS is not the only solution to achieve these interactions without JavaScript, but it does offer a convenient and ready-to-use component approach. The choice of framework depends on the amount of manual markup a developer is willing to write. Ultimately, Alloy CSS provides a way to build interfaces without JavaScript, focusing on performance and security, but accessibility remains a consideration that developers must address separately.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Also reported by 1 other outlet

Every outlet that reported this, and when →

Read the original at dev.to →

More in Tech

Before You Pick an Icon Set, Test These 12 Dashboard Actions -->

The first few icons are easy. Search, add, settings. Then your dashboard needs a billing destination, a share action and a way to export a report.

  • Identify dashboard actions' purpose before selecting icons.
  • Ensure all actions fit within a single icon family and variant.
  • Review unresolved actions to decide on keeping selection or searching alternatives.

More from Tuesday 17 November →