MCPAsk AI

Search

Search skills, authors and topics

kemiljk / skills

dxe-modern-css-html

Choose native CSS and HTML features, assess browser support, or replace legacy workarounds with progressive enhancement.

Install

npx skills add https://github.com/kemiljk/skills --skill dxe-modern-css-html

Modern CSS task recipes

Original guidance for common upgrades. Prefer these over legacy patterns when support allows.

Layout

css
/* Centre */.center { display: grid; place-items: center; }
/* Full viewport on mobile */.screen { min-height: 100dvh; }
/* Component responsiveness */.card-wrap { container-type: inline-size; }@container (width < 400px) {  .card { grid-template-columns: 1fr; }}

Colour

css
:root {  color-scheme: light dark;  --accent: oklch(0.7 0.14 45);  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);  --text: light-dark(oklch(0.25 0.02 260), oklch(0.95 0.01 260));}

Native overlay

html
<button popovertarget="menu">Open</button><div id="menu" popover anchor="trigger">…</div>
css
#menu {  position: absolute;  position-anchor: --trigger;  top: anchor(bottom);  left: anchor(center);  translate: -50% 0.5rem;}

Scroll-driven reveal

css
@media (prefers-reduced-motion: no-preference) {  .reveal {    animation: fade-up linear both;    animation-timeline: view();    animation-range: entry 10% cover 30%;  }}

Replace these habits

Old habitModern default
Absolute centre with translate(-50%, -50%)place-items: center
Padding-top aspect ratio hackaspect-ratio
JS sticky headerposition: sticky
Hex palette + Sass lightenoklch + color-mix
IO + .is-visible class togglesCSS view timelines
Floating UI for simple menusPopover + anchor positioning
100vh mobile shells100dvh