WebCraft

Catalogue

CSS elements with live demos and source code

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

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