Resilient means durable and flexible.
When is CSS resilient?
.resilient {
--when: immutable;
--when: flat;
--when: composable;
}
.not-resilient {
--when: mutable;
--when: nested;
--when: coupled;
}
--antipattern: mutation;
across modules or contexts
.button {}
47 results found for ".button"
.mutable {
--problem: erratic;
--problem: buggy;
--problem: blocking;
}
Erratic. Behavior differs across context.
Buggy. Context is hard to reproduce.
Blocking. Mutation inhibits change.
Erratic
Behavior differs across context
Buggy
Contextual bugs are difficult to reproduce
Blocking
Mutation inhibits change in your codebase
.mutable {
--cost: time;
--cost: quality;
--cost: frustration;
}
.immutable {
--benefit: predictable;
--benefit: stable;
--benefit: agile;
}
--antipattern: nesting;
.drawer {
.header {
.title {
--problem: brittle;
--problem: unfindable;
--problem: overspecific;
}
}
}
.drawer-box {}
.drawer-header {}
.drawer-title {}
.flat {
--benefit: findable;
--benefit: debuggable;
--benefit: interoperable;
--benefit: reusable;
--benefit: performant;
}
.context {
.component {
--antipattern: mutation;
--antipattern: nesting;
}
}
--antipattern: coupling;
.coupled {
color: Lime;
width: 100%;
}
Coupling depends on sharing.
Coupling affects inheritence.
Coupling tempts mutation.
.coupling {
--cost: dependence;
--cost: bloat;
}
.composable {
--benefit: flexible;
--benefit: learnable;
--benefit: systematic;
--benefit: productive;
}
Composition affords dimensions of change.
Destructure design.
Compose approachably.
Balance flexibility vs. governance.
If developers sidestep the system then governance is too extreme.
.resilient {
--when: immutable;
--when: flat;
--when: composable;
}
Thanks for listening!
Extras
Property-centric architecture
Separate files such that the order you load them has no effect on cascade.
<button
class="preset-tap shape-compact tone-primary"
>
<button
class="preset-box ix-tap pad-dense tone-primary"
>
<button
data-preset="control"
data-shape="plush"
data-tone="create"
data-shadow="4am 2pm"
data-spacing="ml1 ml0-first"
>
<button
data-preset="control"
data-shape="plush"
data-tone="create"
data-shadow="4am 2pm"
data-margin="shelf-dense"
>
<button
data-control="control"
data-shape="dense"
data-tone="danger"
data-shadow="raised"
data-margin="left-dense"
>