Urgent.News

What's breaking now, across thousands of outlets.

Tech

The Best CSS Architecture Starts by Deciding What CSS Should Never Do

Also available in Español The Problem A design token system starts clean. Colors, spacing, type scale all values, all legitimate. Then someone needs a quick way to track whether a modal is open, and a custom property is right there, syntactically identical to every token around it. It gets used. Nobody stops to ask whether it should have been. A stylesheet starts as presentation-only. Then a…

The foundation of a strong CSS architecture begins with defining what the system should not do. A design token system initially includes values such as colors, spacing, and type scale. However, when a custom property is needed to track the state of a modal, it can easily be inserted using syntax identical to the existing tokens.

This decision might seem innocuous at the time, as it follows the path of least resistance. Over time, however, the system accumulates permissions by default, without any explicit restrictions. This lack of exclusions allows the system to be asked to do everything, because nothing within it has the authority to refuse. The principle here is that a boundary is a guarantee, not a limitation.

By deciding in advance what CSS will not become, the system maintains its own domain and prevents the inclusion of state or logic. In the case of the token layer, only values are allowed, not application state, as the system declared it would not become a state holder. This approach creates systems that are defined by what they refuse to do, as much as by what they can do.

The strength of a system lies in the decisions made upfront, the boundaries established to prevent future encroachments.

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

Read the original at dev.to →

More in Tech

The Complete Guide to Password Manager Compliance: GDPR, HIPAA, and SOC 2 Explained

Introduction Password managers have become essential infrastructure for both individual users and enterprises managing hundreds of credentials.

  • GDPR compliance requires data minimization and right to data portability.
  • HIPAA mandates encryption, access controls, and a Business Associate Agreement.
  • SOC 2 Type II requires a six-month audit covering security, availability, and privacy.

🇧🇩 Introducing @olism/bd-geo — Bangladesh Geographic Data for JavaScript & TypeScript

🚀 I'm excited to share my new open-source npm package: @olism/bd-geo . @olism/bd-geo is a JavaScript/TypeScript package that provides structured geographical data for Bangladesh, including divisions…

  • @olism/bd-geo package provides Bangladesh geographic data for JS/TS developers
  • Includes divisions, districts, upazilas, areas, and villages dataset
  • Simplifies incorporation of geographic hierarchy in location-based apps

More from Tuesday 25 August →