@daydreamui/good-css 0.0.0-stage → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +77 -2
  2. package/dist/index.js +2 -0
  3. package/icon.svg +8 -0
  4. package/knowledge/INDEX.md +67 -0
  5. package/knowledge/compatibility.md +33 -0
  6. package/knowledge/examples/container-queries-with-container-units.md +150 -0
  7. package/knowledge/examples/content-grid-with-breakouts.md +161 -0
  8. package/knowledge/examples/intrinsic-grid.md +150 -0
  9. package/knowledge/examples/sidebar-that-wraps-on-its-own.md +156 -0
  10. package/knowledge/examples/subgrid-rows-shared-across-cards.md +154 -0
  11. package/knowledge/procedures.md +37 -0
  12. package/knowledge/recipes/accordion-that-animates-its-height.md +59 -0
  13. package/knowledge/recipes/anchor-targets-that-clear-a-sticky-header.md +45 -0
  14. package/knowledge/recipes/carousel-on-native-scroll.md +87 -0
  15. package/knowledge/recipes/concentric-nested-radius.md +45 -0
  16. package/knowledge/recipes/container-queries-with-container-units.md +52 -0
  17. package/knowledge/recipes/content-clear-of-the-notch.md +45 -0
  18. package/knowledge/recipes/content-grid-with-breakouts.md +69 -0
  19. package/knowledge/recipes/cross-document-view-transitions.md +39 -0
  20. package/knowledge/recipes/enter-and-exit-transitions-from-display-none.md +87 -0
  21. package/knowledge/recipes/fluid-sizes-with-clamp.md +46 -0
  22. package/knowledge/recipes/form-feedback-with-user-invalid.md +45 -0
  23. package/knowledge/recipes/has-for-parent-and-page-state.md +46 -0
  24. package/knowledge/recipes/hit-area-larger-than-the-visual.md +47 -0
  25. package/knowledge/recipes/hover-styles-only-where-hover-exists.md +43 -0
  26. package/knowledge/recipes/icon-sized-by-the-text-beside-it.md +69 -0
  27. package/knowledge/recipes/image-box-that-holds-any-upload.md +67 -0
  28. package/knowledge/recipes/indicator-that-slides-to-the-active-item.md +80 -0
  29. package/knowledge/recipes/intrinsic-grid.md +41 -0
  30. package/knowledge/recipes/label-centered-on-its-letters-with-text-box.md +59 -0
  31. package/knowledge/recipes/logical-properties.md +48 -0
  32. package/knowledge/recipes/long-text-that-wraps-truncates-or-clamps.md +62 -0
  33. package/knowledge/recipes/motion-tokens.md +46 -0
  34. package/knowledge/recipes/no-rubber-band-bounce-on-desktop.md +47 -0
  35. package/knowledge/recipes/oklch-color.md +41 -0
  36. package/knowledge/recipes/one-fluid-scale-for-type-and-space.md +85 -0
  37. package/knowledge/recipes/one-focus-ring-with-focus-visible.md +44 -0
  38. package/knowledge/recipes/one-set-of-color-tokens-for-light-and-dark.md +53 -0
  39. package/knowledge/recipes/opt-in-motion.md +43 -0
  40. package/knowledge/recipes/overflow-clip-over-hidden.md +41 -0
  41. package/knowledge/recipes/popover-anchored-to-its-trigger.md +57 -0
  42. package/knowledge/recipes/press-feedback.md +43 -0
  43. package/knowledge/recipes/push-one-item-away-with-an-auto-margin.md +70 -0
  44. package/knowledge/recipes/reveal-with-clip-path.md +61 -0
  45. package/knowledge/recipes/safe-alignment.md +41 -0
  46. package/knowledge/recipes/scroll-area-between-a-fixed-header-and-footer.md +67 -0
  47. package/knowledge/recipes/section-spacing-that-depends-on-its-neighbors.md +54 -0
  48. package/knowledge/recipes/shadow-change-that-fades-and-does-not-repaint.md +80 -0
  49. package/knowledge/recipes/sidebar-that-wraps-on-its-own.md +56 -0
  50. package/knowledge/recipes/space-between-siblings-set-by-the-parent.md +59 -0
  51. package/knowledge/recipes/stack-layers-with-grid.md +43 -0
  52. package/knowledge/recipes/styles-that-apply-only-when-a-scroller-overflows.md +99 -0
  53. package/knowledge/recipes/subgrid-rows-shared-across-cards.md +51 -0
  54. package/knowledge/recipes/tabular-numbers.md +40 -0
  55. package/knowledge/recipes/textarea-that-grows-with-its-content.md +73 -0
  56. package/knowledge/recipes/the-reset.md +96 -0
  57. package/knowledge/recipes/transition-a-custom-property-with-property.md +70 -0
  58. package/knowledge/recipes/whole-card-clickable-from-one-link.md +71 -0
  59. package/knowledge/upstream-guidance.md +72 -0
  60. package/manifest.json +12 -0
  61. package/package.json +15 -4
  62. package/playgrounds/base.css +57 -0
  63. package/playgrounds/container-queries-with-container-units.css +10 -0
  64. package/playgrounds/container-queries-with-container-units.html +13 -0
  65. package/playgrounds/content-grid-with-breakouts.css +21 -0
  66. package/playgrounds/content-grid-with-breakouts.html +13 -0
  67. package/playgrounds/fixtures.json +32 -0
  68. package/playgrounds/intrinsic-grid.css +5 -0
  69. package/playgrounds/intrinsic-grid.html +19 -0
  70. package/playgrounds/sidebar-that-wraps-on-its-own.css +16 -0
  71. package/playgrounds/sidebar-that-wraps-on-its-own.html +13 -0
  72. package/playgrounds/subgrid-rows-shared-across-cards.css +12 -0
  73. package/playgrounds/subgrid-rows-shared-across-cards.html +13 -0
  74. package/upstream/LICENSE +21 -0
  75. package/upstream/lock.json +7 -0
@@ -0,0 +1,10 @@
1
+ .slot { container-type: inline-size; }
2
+
3
+ .card h2 { font-size: clamp(1.25rem, 1rem + 2cqi, 2rem); }
4
+
5
+ @container (width > 30rem) {
6
+ .card {
7
+ display: grid;
8
+ grid-template-columns: 12rem 1fr;
9
+ }
10
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Container query card</title>
7
+ <link rel="stylesheet" href="base.css">
8
+ <link rel="stylesheet" href="container-queries-with-container-units.css">
9
+ </head>
10
+ <body>
11
+ <h1>Container query card</h1><main class="slot"><article class="card"><h2>A responsive card</h2><p>Above 30rem of container space the title and text sit side by side. The heading also scales with the container.</p></article></main>
12
+ </body>
13
+ </html>
@@ -0,0 +1,21 @@
1
+ .content-grid {
2
+ --gutter: 1.5rem;
3
+ --content: 64rem;
4
+ --breakout: 80rem;
5
+
6
+ display: grid;
7
+ grid-template-columns:
8
+ [full-width-start] minmax(var(--gutter), 1fr)
9
+ [breakout-start] minmax(0, calc((var(--breakout) - var(--content)) / 2))
10
+ [content-start] min(100% - var(--gutter) * 2, var(--content)) [content-end]
11
+ minmax(0, calc((var(--breakout) - var(--content)) / 2)) [breakout-end]
12
+ minmax(var(--gutter), 1fr) [full-width-end];
13
+ }
14
+
15
+ :is(.content-grid, .full-width) > * { grid-column: content; }
16
+ :is(.content-grid, .full-width) > .breakout { grid-column: breakout; }
17
+ :is(.content-grid, .full-width) > .full-width {
18
+ grid-column: full-width;
19
+ display: grid;
20
+ grid-template-columns: inherit;
21
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Content grid with breakouts</title>
7
+ <link rel="stylesheet" href="base.css">
8
+ <link rel="stylesheet" href="content-grid-with-breakouts.css">
9
+ </head>
10
+ <body>
11
+ <h1>Content grid with breakouts</h1><main class="content-grid"><section class="panel"><h2>Content width</h2><p>The default column.</p></section><section class="panel breakout"><h2>Breakout width</h2></section><section class="full-width"><h2>Full width</h2><p>Its child returns to the content column.</p></section></main>
12
+ </body>
13
+ </html>
@@ -0,0 +1,32 @@
1
+ [
2
+ {
3
+ "slug": "intrinsic-grid",
4
+ "title": "Intrinsic grid",
5
+ "body": "<h1>Intrinsic grid</h1>\n<main class=\"grid\"><article><h2>Card 1</h2><p>Content determines how the row wraps.</p></article>\n<article><h2>Card 2</h2><p>Content determines how the row wraps.</p></article>\n<article><h2>Card 3</h2><p>Content determines how the row wraps.</p></article>\n<article><h2>Card 4</h2><p>Content determines how the row wraps.</p></article>\n<article><h2>Card 5</h2><p>Content determines how the row wraps.</p></article>\n<article><h2>Card 6</h2><p>Content determines how the row wraps.</p></article></main>",
6
+ "experiment": "Resize from 960 to 320px. Columns wrap at their 16rem minimum without a media query; change that minimum and compare auto-fit with auto-fill."
7
+ },
8
+ {
9
+ "slug": "sidebar-that-wraps-on-its-own",
10
+ "title": "Wrapping sidebar",
11
+ "body": "<h1>Wrapping sidebar</h1><div class=\"with-sidebar\"><aside class=\"sidebar\">Sidebar with an ideal width</aside><main class=\"main\"><h2>Article</h2><p>The main content keeps at least half the available row and sends the sidebar onto its own row when space runs out.</p></main></div>",
12
+ "experiment": "Resize from 960 to 320px. The sidebar and article wrap into separate rows. Adjust flex-basis and min-inline-size to move the wrap point."
13
+ },
14
+ {
15
+ "slug": "subgrid-rows-shared-across-cards",
16
+ "title": "Aligned card rows",
17
+ "body": "<h1>Aligned card rows</h1><main class=\"cards\"><article class=\"card\"><h2>Short heading</h2><p>A brief summary.</p><footer>Details</footer></article><article class=\"card\"><h2>A heading long enough to wrap onto several lines</h2><p>More content, with a longer description to make the row heights visibly shared across neighboring cards.</p><footer>Details</footer></article><article class=\"card\"><h2>Third card</h2><p>Another summary.</p><footer>Details</footer></article></main>",
18
+ "experiment": "At 960px, card headings, descriptions and footers share rows despite different text lengths. At 320px cards form a single column. Edit a heading to see its neighbors respond."
19
+ },
20
+ {
21
+ "slug": "container-queries-with-container-units",
22
+ "title": "Container query card",
23
+ "body": "<h1>Container query card</h1><main class=\"slot\"><article class=\"card\"><h2>A responsive card</h2><p>Above 30rem of container space the title and text sit side by side. The heading also scales with the container.</p></article></main>",
24
+ "experiment": "Resize the slot above and below 30rem. The card changes layout against its ancestor container, while its title scales with cqi. Change the slot width independently of the viewport."
25
+ },
26
+ {
27
+ "slug": "content-grid-with-breakouts",
28
+ "title": "Content grid with breakouts",
29
+ "body": "<h1>Content grid with breakouts</h1><main class=\"content-grid\"><section class=\"panel\"><h2>Content width</h2><p>The default column.</p></section><section class=\"panel breakout\"><h2>Breakout width</h2></section><section class=\"full-width\"><h2>Full width</h2><p>Its child returns to the content column.</p></section></main>",
30
+ "experiment": "Compare the content, breakout and full-width tracks at 1440px and 320px. Change --content, --breakout and --gutter; every child stays on a named track."
31
+ }
32
+ ]
@@ -0,0 +1,5 @@
1
+ .grid {
2
+ display: grid;
3
+ gap: 1rem;
4
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
5
+ }
@@ -0,0 +1,19 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Intrinsic grid</title>
7
+ <link rel="stylesheet" href="base.css">
8
+ <link rel="stylesheet" href="intrinsic-grid.css">
9
+ </head>
10
+ <body>
11
+ <h1>Intrinsic grid</h1>
12
+ <main class="grid"><article><h2>Card 1</h2><p>Content determines how the row wraps.</p></article>
13
+ <article><h2>Card 2</h2><p>Content determines how the row wraps.</p></article>
14
+ <article><h2>Card 3</h2><p>Content determines how the row wraps.</p></article>
15
+ <article><h2>Card 4</h2><p>Content determines how the row wraps.</p></article>
16
+ <article><h2>Card 5</h2><p>Content determines how the row wraps.</p></article>
17
+ <article><h2>Card 6</h2><p>Content determines how the row wraps.</p></article></main>
18
+ </body>
19
+ </html>
@@ -0,0 +1,16 @@
1
+ .with-sidebar {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ gap: 1rem;
5
+ }
6
+
7
+ .sidebar {
8
+ flex-basis: 20rem;
9
+ flex-grow: 1;
10
+ }
11
+
12
+ .main {
13
+ flex-basis: 0;
14
+ flex-grow: 999;
15
+ min-inline-size: 50%;
16
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Wrapping sidebar</title>
7
+ <link rel="stylesheet" href="base.css">
8
+ <link rel="stylesheet" href="sidebar-that-wraps-on-its-own.css">
9
+ </head>
10
+ <body>
11
+ <h1>Wrapping sidebar</h1><div class="with-sidebar"><aside class="sidebar">Sidebar with an ideal width</aside><main class="main"><h2>Article</h2><p>The main content keeps at least half the available row and sends the sidebar onto its own row when space runs out.</p></main></div>
12
+ </body>
13
+ </html>
@@ -0,0 +1,12 @@
1
+ .cards {
2
+ display: grid;
3
+ gap: 1.5rem;
4
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
5
+ }
6
+
7
+ .card {
8
+ display: grid;
9
+ grid-row: span 3;
10
+ grid-template-rows: subgrid;
11
+ row-gap: 0.5rem;
12
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Aligned card rows</title>
7
+ <link rel="stylesheet" href="base.css">
8
+ <link rel="stylesheet" href="subgrid-rows-shared-across-cards.css">
9
+ </head>
10
+ <body>
11
+ <h1>Aligned card rows</h1><main class="cards"><article class="card"><h2>Short heading</h2><p>A brief summary.</p><footer>Details</footer></article><article class="card"><h2>A heading long enough to wrap onto several lines</h2><p>More content, with a longer description to make the row heights visibly shared across neighboring cards.</p><footer>Details</footer></article><article class="card"><h2>Third card</h2><p>Another summary.</p><footer>Details</footer></article></main>
12
+ </body>
13
+ </html>
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vojta Holik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ {
2
+ "revision": "6d16d2fd27f4892e2aea4b5c5c2b016f45be7eef",
3
+ "files": {
4
+ "PRACTICES.md": "6083f4e3cb69d78cfd34815d2e941ef580328ce96cd4b6ab109608e0909cab70",
5
+ "LICENSE": "dcdeb88707627233bbc76f69febd77ef78a665424a0e0194b3416a473d33cede"
6
+ }
7
+ }