SShortSingh.
Back to feed

CSS Variables Beat JSON Tokens for Web Design Systems, Developers Argue

0
·1 views

A code review incident highlighted a growing frustration among web developers: design system teams often export tokens as deeply nested JSON files, forcing developers to write complex JavaScript utilities just to apply basic styles like colours and spacing. Critics argue this approach bloats JavaScript bundles and forces the browser to download and parse style data before it can render the page correctly. CSS custom properties, commonly known as CSS variables, offer a native browser alternative that is simpler to implement and far easier to debug using standard developer tools. Switching themes with CSS variables requires only a class change on the HTML body element, whereas JSON-based token pipelines often require full React component tree re-renders. The core argument is that design system teams are optimising for abstract architecture rather than leveraging the browser's built-in, highly efficient styling engine.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Oracle SQL: Four Built-in JSON Functions That Transform Relational Data

Oracle Database offers four built-in SQL functions — JSON_OBJECT, JSON_OBJECTAGG, JSON_ARRAY, and JSON_ARRAYAGG — to convert relational table data into JSON format directly within SQL queries. JSON_OBJECT and JSON_ARRAY are scalar functions that operate row by row, producing a JSON object or array for each individual record. In contrast, JSON_OBJECTAGG and JSON_ARRAYAGG are aggregate functions that consolidate multiple rows into a single JSON document or array respectively. JSON_ARRAYAGG is particularly useful in API development and reporting, while JSON_OBJECTAGG suits scenarios requiring dynamic serialization of query results for REST APIs or NoSQL migrations. Developers can practice these functions using Oracle's standard EMP table, which contains employee fields such as EMPNO, ENAME, JOB, and SAL.

0
ProgrammingDEV Community ·

Oracle PL/SQL: How Pipelined Table Functions Outperform Regular Ones

Oracle PL/SQL offers two types of table functions — regular and pipelined — both capable of returning collections queryable directly in SQL FROM clauses. Regular table functions load the entire result set into PGA memory before returning data, leading to higher memory usage and slower time-to-first-row, making them suitable mainly for small datasets. Pipelined functions, by contrast, stream rows incrementally to the caller using the PIPE ROW construct, significantly reducing memory overhead and improving responsiveness for large ETL or real-time data operations. A key syntax rule requires that the RETURN statement in a pipelined function remain empty — passing a variable causes a PLS-00633 compilation error. Additionally, the TABLE() wrapper mandatory in Oracle 11g and earlier became optional from Oracle Database 12c Release 2 onward.

0
ProgrammingDEV Community ·

Oracle PL/SQL: Key Differences Between CASE Expression and CASE Statement

In Oracle PL/SQL, the CASE Expression and CASE Statement serve distinct purposes despite sharing similar syntax. A CASE Expression evaluates a condition and returns a single scalar value, making it suitable for assignments or inline SQL use, while a CASE Statement executes one or more procedural actions based on conditions. Their termination syntax also differs: CASE Statements close with END CASE; whereas CASE Expressions end with END. A critical behavioral difference involves unhandled cases — a CASE Statement with no matching WHEN clause and no ELSE raises a runtime ORA-06592 exception, while a CASE Expression silently returns NULL under the same circumstances. Developers should account for these distinctions to avoid unexpected runtime errors in production PL/SQL code.

0
ProgrammingDEV Community ·

Rails gem 'viewing_as' adds read-only, audited admin impersonation with write guards

Delist My Data, a personal data removal service, built a customer account impersonation feature for its admin team that enforces read-only access and maintains a transparent audit log visible to customers. Existing Rails gems like pretender and devise_masquerade handle user-switching but lack write restrictions, session timeouts, or customer-facing audit trails. The team addressed this with two protection layers: a before_action that blocks non-GET/HEAD requests during impersonation, and ActiveRecord's while_preventing_writes to catch any writes that slip through via GET routes. The solution also uses signed cookies to lock session settings like read-only mode so nothing can be altered from the browser mid-session. Last week, the company extracted the feature into an open-source gem called viewing_as for other Rails developers to use.