SlideShare a Scribd company logo
Declarative
Design
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
programming
imperative
programming
1. create an array of items
2. loop through each item
3. test if a condition is true
4. return the result
declarative
programming
Structured
Query
Language
SELECT items FROM table
WHERE condition IS TRUE
World
Wide
Web
JavaScript
CSS
HTML
imperative
declarative
programming
mindset
imperative
declarative
button
<div
tabindex={0}
onClick={onClickButtonHandler}
onKeyDown={onKeyDownHandler}
onKeyUp={onKeyUpHandler}
role="button"
>
example
</div>
function isDisabled(eventTarget) {
const ariaDisabled = eventTarget.getAttribute("aria-disabled");
const isDisabled = ariaDisabled === "" || ariaDisabled === "true";
return isDisabled;
}
function onKeyDownHandler(event) {
if (event.key === " ") {
// We have to disable default space behavior which is scrolling page down.
event.preventDefault();
}
if (event.key === "Enter" && !isDisabled(event.target)) {
onClickButtonHandler();
}
}
function onKeyUpHandler(event) {
if (event.key === " " && !isDisabled(event.target)) {
onClickButtonHandler();
}
}
<div
tabindex={0}
onClick={onClickButtonHandler}
onKeyDown={onKeyDownHandler}
onKeyUp={onKeyUpHandler}
role="button"
>
example
</div>
function isDisabled(eventTarget) {
const ariaDisabled = eventTarget.getAttribute("aria-disabled");
const isDisabled = ariaDisabled === "" || ariaDisabled === "true";
return isDisabled;
}
function onKeyDownHandler(event) {
if (event.key === " ") {
// We have to disable default space behavior which is scrolling page down.
event.preventDefault();
}
if (event.key === "Enter" && !isDisabled(event.target)) {
onClickButtonHandler();
}
}
function onKeyUpHandler(event) {
if (event.key === " " && !isDisabled(event.target)) {
onClickButtonHandler();
}
}
<button>
example
</button>
<div
tabindex={0}
onClick={onClickButtonHandler}
onKeyDown={onKeyDownHandler}
onKeyUp={onKeyUpHandler}
role="button"
>
example
</div>
function isDisabled(eventTarget) {
const ariaDisabled = eventTarget.getAttribute("aria-disabled");
const isDisabled = ariaDisabled === "" || ariaDisabled === "true";
return isDisabled;
}
function onKeyDownHandler(event) {
if (event.key === " ") {
// We have to disable default space behavior which is scrolling page down.
event.preventDefault();
}
if (event.key === "Enter" && !isDisabled(event.target)) {
onClickButtonHandler();
}
}
function onKeyUpHandler(event) {
if (event.key === " " && !isDisabled(event.target)) {
onClickButtonHandler();
}
}
button
control
control
imperative
control
imperative
declarative
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
utopia.fyi
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
calc()
clamp()
min() and max()
fi
t-content
min-content and max-content
repeat()
minmax()
youtube.com/layoutland
every-layout.dev
buildexcellentwebsit.es
declarative design
declarative > imperative?
it depends
declarative > imperative?
culture
management
imperative
management
imperative
declarative
management
culture
design systems
imperative
declarative
design systems
thinking
analytic
thinking
systems
thinking
design systems
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
#B45B39
#912D0E
#571D0B
#421709
#CD262F
#A60003
#6B0002
#520001
#CEA32E
#AB7906
#866004
#523C02
Th
e border should be 10% lighter
than the background colour.”
“
declarative > imperative?
design systems
it depends
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
it depends
the medium
print
native apps
os-speci
fi
c
print
native apps
os-speci
fi
c
World
Wide
Web
World
Wide
Web
Th
e more you tighten your grip, the more the
World Wide Web slips through your
fi
ngers.”
“
a dao of web design
responsive web design
declarative design
Thank you

More Related Content

Declarative Design - Jeremy Keith - Wey Wey Wey 2023