Patterns of UI
Components
Design Patterns
Grid System
Design Tokens
Hierarki
Components
Design Patterns
Hierarki
Grid System
Design Tokens
"17 individual fixes"
#495dc5
100
200
300
400
500
600
700
800
100
200
300
400
500
600
700
800
200
500
800
Du vil typisk bruge unitless.
use this number multiplied by the element's font size
~ 1.5-1.6 til brødtekst
~ 1.1 til store overskrifter
~ 1.25-1.3 til mindre overskrifter
Tilføj spacing til kortet
.flow {
> * + * {
margin-block-start: var(--flow-space, 1rlh); /* margin-top */
}
h2 {
--flow-space: 2rlh;
}
}
article {
padding: 2rlh;
gap: 1rlh;
}
øvelse
Lav øvelsen, der ligger på git-branch'en
"flow-space" på GitHub
.flow {
> * + * {
margin-top: var(--flow-space, 1rlh);
}
h2 {
--flow-space: 2rlh;
}
}
h1,
h2,
h3 {
text-wrap: balance;
}
p {
text-wrap: pretty;
}
p:first-letter {
initial-letter: 3;
}
Fluid type scale
Fluid spacing scale
p {
--step-0: clamp(1.35rem, 1.0926rem + 1.098cqi, 1.875rem);
font-size: round(var(--step-0), 1px);
line-height: round(var(--step-0) * 1.5, 4px);
}
øvelse
Lav øvelsen, der ligger på git-branch'en
"text-styling" på GitHub
øvelse
Diskuter og identificer mulige forbedringer til dette card UI sammen med din sidemakker.
Lav derefter øvelsen, der ligger på git-branch'en "card-ui" på GitHub
.valid-css-color-function-colors {
--srgb: color(srgb 1 1 1);
--srgb-linear: color(srgb-linear 100% 100% 100% / 50%);
--display-p3: color(display-p3 1 1 1);
--rec2020: color(rec2020 0 0 0);
--a98-rgb: color(a98-rgb 1 1 1 / 25%);
--prophoto: color(prophoto-rgb 0% 0% 0%);
--xyz: color(xyz 1 1 1);
}
.most-hyped {
--display-p3: color(display-p3 1 1 1);
--rec2020: color(rec2020 0 0 0);
}
.element {
background: oklch(80% 50% 220);
}
lightness
chroma
hue
Næsten ligesom hsl()
Blanding af farver
.bar {
/* color-mix(in <color-space>, <color>, <color> <percentage>) */
background: color-mix(in srgb, ...);
}
hover- og active-state
button {
background: #FFCC4A;
&:hover {
background: oklch( from #FFCC4A calc(l - .05) c h );
}
&:active {
background: oklch( from #FFCC4A calc(l - .1) c h );
}
}