Chain of Responsibility
Pass the request along a chain of selectors using the cascade and specificity.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Chain of Responsibility
ARCANUM SCHOOL: Divination // Cascading Checks
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
/* Chain of responsibility using CSS cascade and specificity */
/* Base handler: minimal specificity */
a { color: blue; text-decoration: none; }
/* Higher tier handler: context aware */
.spell-book a { color: purple; border-bottom: 1px dotted purple; }
/* Specialized handler: interaction state */
.spell-book a:hover { color: magenta; border-bottom-style: solid; }
/* Final override handler: absolute authority */
.spell-book a.cursed { color: red !important; pointer-events: none; }
The cascade inherently mimics the Chain of Responsibility. A style request falls through successive rules, gaining specificity until a final definition strictly overrides the rest.
Runic Tags:
#css
#cascade
#specificity
#design-patterns