WebCraft

Catalogue

CSS elements with live demos and source code

104 interface elements, each rendered live on its own page with the source and the one thing that breaks it.

  1. A pricing card that is still a radio :has(:checked) form
  2. A list marker you define yourself @counter-style text
  3. Marking text without touching the DOM ::highlight() text
  4. A fallback font that does not move the page size-adjust type
  5. A menu exactly as wide as its button anchor-size() menu
  6. Type snapped to a baseline grid round() type
  7. A component that reads its own token @container style() layout
  8. A clip path that can be animated clip-path: shape() surface
  9. Corners that are not arcs corner-shape surface
  10. Tab order that follows what you see reading-flow a11y
  11. Content above that stops pushing you down overflow-anchor scroll
  12. Cards that stack as you scroll timeline-scope scroll
  13. Rows the browser refuses to lay out content-visibility: auto loading
  14. A dial laid out by ray() offset-path: ray() control
  15. The jump when a scrollbar arrives scrollbar-gutter: stable scroll
  16. The full height a phone actually gives you svh / dvh / lvh layout
  17. Text the find bar can still reach hidden="until-found" disclosure
  18. A dialog opened with no script at all command / commandfor dialog
  19. A select you can finally style appearance: base-select form
  20. A bar sized by its own data attribute attr() type() layout
  21. A stagger that survives a new item sibling-index() motion
  22. Card rows that line up across cards subgrid layout
  23. A sticky header that knows it is stuck scroll-state(stuck) scroll
  24. Hover that stays off touchscreens @media (hover: hover) hover
  25. The filled half of a range track ::-moz-range-progress form
  26. Numbering the browser keeps for you counters() text
  27. An underline you actually drew text-underline-offset type
  28. Type on rails, not on stops clamp() type
  29. The fixed element that stopped meaning it fixed under transform layout
  30. A shadow that knows the shape filter: drop-shadow() surface
  31. The long word that will not bend overflow-wrap: anywhere text
  32. An ellipsis is three declarations, not one text-overflow: ellipsis text
  33. Less motion is not no motion prefers-reduced-motion motion
  34. A layout drawn as a picture of itself grid-template-areas layout
  35. Four faint shadows beat one dark one box-shadow ×4 surface
  36. Five colours out of one token oklch(from …) surface
  37. Hidden from eyes, kept for readers .visually-hidden a11y
  38. The link only keyboards ever meet skip link + :focus a11y
  39. The same two colours, mixed two ways color-mix() surface
  40. Why the last row stretches, and how to stop it auto-fit vs auto-fill layout
  41. Centring with no flex and no grid align-content (block) layout
  42. An edge that fades instead of cutting mask-composite: intersect scroll
  43. A vertical label that does not break the box writing-mode: vertical-rl layout
  44. A heading that sits on its own cap height text-box: trim-both type
  45. Type that inverts itself over anything mix-blend-mode: difference surface
  46. An outline that does not eat the letters paint-order: stroke fill type
  47. A drop cap the browser measures for you initial-letter text
  48. Stripes that stay right when rows are filtered :nth-child(of S) table
  49. One declaration that covers both themes light-dark() surface
  50. Carousel dots the browser draws itself ::scroll-marker scroll
  51. A tooltip that follows its anchor with no JavaScript anchor-name + position-area layout
  52. Styles that stop at a boundary you name @scope layout
  53. Animating height to auto, finally interpolate-size motion
  54. A spring in the easing function linear() motion
  55. Type that wraps to a curve, not a box shape-outside type
  56. Reveal on scroll, with no observer animation-timeline: view() motion
  57. Clipping that leaves sticky alone overflow: clip layout
  58. A dropdown a keyboard can hold open :focus-within a11y
  59. Avatars that never squash object-fit: cover media
  60. An underline that slides in background-size hover
  61. An analog clock wound by one line of JavaScript animation-delay: -43200s motion
  62. The logo that never hits the corner animation + cqw motion
  63. resize keeps writing after max-width stops it resize + max-width layout
  64. A gradient border that keeps its corners background + padding surface
  65. A spotlight that follows the cursor radial-gradient at var() hover
  66. A progress bar tied to scroll, with no JavaScript animation-timeline: scroll() motion
  67. A table header that stays put position: sticky table
  68. Cut a paragraph to three lines -webkit-line-clamp text
  69. A textarea that grows as you type field-sizing: content form
  70. An accordion with no JavaScript <details name> disclosure
  71. A focus ring for keyboards only :focus-visible a11y
  72. A wide table that keeps its first column position: sticky (inline) table
  73. Shadows that show there is more to scroll background-attachment: local scroll
  74. A segmented control with a sliding indicator :has() + translate control
  75. A skeleton that does not lie about the layout @keyframes + gradient loading
  76. A menu button that turns into a close button aria-expanded menu
  77. A switch that is still a checkbox appearance: none form
  78. A marquee that never jumps translateX(-50%) motion
  79. Frosted glass over anything backdrop-filter surface
  80. Type painted with a gradient background-clip: text type
  81. A range slider you can actually style ::-webkit-slider-thumb, ::-moz-range-thumb form
  82. A card that tips towards the cursor perspective + rotate hover
  83. A gradient angle that actually animates @property motion
  84. A card that reads its own container, not the window @container layout
  85. Type that scales with its container cqi layout
  86. Boxes that keep their proportions aspect-ratio layout
  87. A heading that breaks where a typesetter would text-wrap: balance type
  88. Paragraphs with no orphan last line text-wrap: pretty type
  89. Hyphenation in a narrow column hyphens: auto type
  90. An error state that waits its turn :user-invalid form
  91. Native controls in your palette accent-color form
  92. A label that floats out of the way :placeholder-shown form
  93. A carousel the browser drives scroll-snap-type scroll
  94. Scrolling that stops at the edge overscroll-behavior scroll
  95. Anchor links that clear a sticky header scroll-padding-top scroll
  96. A wrapper that knows its input is wrong :has() state
  97. Hovering one row quiets the others :has() + :not() hover
  98. A layout that changes when the list gets long :has(:nth-child()) layout
  99. A modal that traps focus for you showModal() dialog
  100. A popover with no JavaScript at all popovertarget dialog
  101. A section the page cannot reach inert a11y
  102. Animating something in from display: none @starting-style motion
  103. The exit animation, which is the hard half allow-discrete motion
  104. Reordering a list without it jumping startViewTransition() motion