Decorator
Attach additional responsibilities to an object dynamically via pseudo-elements.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Decorator
ARCANUM SCHOOL: Illusion // Ethereal Attachments
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
.enchanted-text {
position: relative;
display: inline-block;
}
/* Adding a glowing aura dynamically without changing the base element */
.enchanted-text::before {
content: '';
position: absolute;
inset: -5px;
border: 2px solid cyan;
filter: blur(4px);
z-index: -1;
border-radius: inherit;
}
Using pseudo-elements (::before, ::after), the Decorator pattern adds complex visual flairs (shadows, auras, borders) without bloating the HTML structure.
Runic Tags:
#css
#pseudo-elements
#enhancement
#design-patterns