Browser compatibility & Progressive enhancement
Adopting modern CSS features enable developers to:
Mål: Vide, hvordan vi håndterer det
Strategier
.element {
background: #0000ff;
background: color(rec2020 0 0 1);
}p {
text-wrap: pretty;
}html {
interpolate-size: allow-keywords;
}:open::details-content {
block-size: auto;
}@view-transition {
navigation: auto;
}p {
text-wrap: pretty;
}select,
::picker(select){
appearance: base-select;
}@view-transition {
navigation: auto;
}details {
interpolate-size: allow-keywords;
}:open::details-content {
block-size: calc-size(auto, size);
}h1 {
text-box: trim-start cap alphabetic;
@supports not (text-box-trim: trim-both) {
margin-top: calc(.5cap - .5lh);
}
}@supports (view-timeline: --my-timeline) {
...
}
@supports selector(::details-content) {
}
@supports not (interpolate-size: allow-keywords) {
[open]::details-content {
...
}
}<script src="https://flackr.github.io/scroll-timeline/dist/scroll-timeline.js"></script>.element {
animation: --move linear both;
animation-timeline: view();
}if (!CSS.supports('animation-timeline: scroll()')) {
// importer GSAP