Knowledgebase

Styling: Everything That Matters, Briefly Print

  • frontenddevelopment, frontend, guide, howto, solution, zillionkinghost, hosting, support
  • 0

The summary.

WHAT MATTERS MOST AT SCALE

Whether styles can be found, understood and removed safely. Unused styles accumulate, and nobody deletes what they cannot trace.

EVERY APPROACH NEEDS DEFINED TOKENS

Colour, spacing and type, with semantic names, implemented as custom properties so they work at runtime and enable theming.

Audit how many distinct values are actually in use — it is always far more than intended.

WITH A UTILITY FRAMEWORK, THE CONFIGURATION IS YOUR DESIGN SYSTEM

Arbitrary values everywhere defeat the constraint that makes it worthwhile.

Extract repetition into components, not into new classes.

CUSTOMISE A COMPONENT FRAMEWORK THROUGH ITS VARIABLES, NOT BY OVERRIDING

Overriding fights specificity and grows unmanageable. And build from source to include only what you use.

THE PLATFORM NOW PROVIDES VARIABLES AND NESTING NATIVELY

Less of a preprocessor is needed than before, and custom properties can change at runtime while build-time variables cannot.

Limit nesting — deep nesting produces high specificity invisibly.

SCOPING DOES NOT PRODUCE CONSISTENCY

Each component can still use arbitrary values. Pair scoping with tokens.

ESTABLISH ONE STYLING APPROACH PER PROJECT.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot