@ghostly-ui/core 0.2.2 → 0.2.3

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 (2) hide show
  1. package/dist/ghostly.css +33 -10
  2. package/package.json +1 -1
package/dist/ghostly.css CHANGED
@@ -77,16 +77,39 @@
77
77
  --_ghostly-display: inline-block;
78
78
  }
79
79
 
80
- /* ── Prevent text elements from collapsing horizontally ──
81
- Since text is transparent, the element's width comes from the text
82
- content. When content is empty ('') the element collapses to 0 width.
83
- We use min-width to prevent this. When real (visible) content is loaded,
84
- the content width will naturally exceed the min-width. */
85
- [data-ghostly] :where(h1) { min-width: 60%; }
86
- [data-ghostly] :where(h2) { min-width: 50%; }
87
- [data-ghostly] :where(h3) { min-width: 45%; }
88
- [data-ghostly] :where(h4, h5, h6) { min-width: 40%; }
89
- [data-ghostly] :where(p) { min-width: 80%; }
80
+ /* ── Layout preservation ──
81
+ The critical problem: when text is empty, flex children collapse to 0 width.
82
+ Solution: force non-leaf containers to grow, and text elements to fill.
83
+ Uses !important to beat utility-class frameworks (Tailwind, etc). */
84
+
85
+ /* Non-leaf containers (divs wrapping text/images) must expand in flex/grid.
86
+ flex-grow:1 makes them fill available space instead of collapsing. */
87
+ [data-ghostly] div,
88
+ [data-ghostly] section,
89
+ [data-ghostly] article,
90
+ [data-ghostly] main,
91
+ [data-ghostly] aside,
92
+ [data-ghostly] header,
93
+ [data-ghostly] footer,
94
+ [data-ghostly] nav {
95
+ flex-grow: 1 !important;
96
+ min-width: 0 !important;
97
+ }
98
+
99
+ /* Leaf containers (empty divs used as placeholders like avatars)
100
+ should NOT grow — they have their own explicit dimensions. */
101
+ [data-ghostly] div:empty {
102
+ flex-grow: 0 !important;
103
+ flex-shrink: 0 !important;
104
+ }
105
+
106
+ /* Text elements: fill full width of their parent */
107
+ [data-ghostly] :where(h1, h2, h3, h4, h5, h6, p, pre,
108
+ blockquote, figcaption, caption, summary, address) {
109
+ width: 100%;
110
+ }
111
+
112
+ /* Inline-turned-block: reasonable minimums */
90
113
  [data-ghostly] :where(span, a, em, strong, small, label, time, code) { min-width: 3rem; }
91
114
  [data-ghostly] :where(button) { min-width: 5rem; }
92
115
  [data-ghostly] :where(input, textarea, select) { min-width: 6rem; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghostly-ui/core",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Zero-config skeleton loaders. Wrap your component, done.",
5
5
  "license": "MIT",
6
6
  "type": "module",