5 ms·
Gave you a star as well. Love the idea and the demo/configurator is very slick. Looked at the "how it works" -- is there a way to manually specify leaf element
by fraywing 6mo ago
Gave you a star as well. Love the idea and the demo/configurator is very slick.
Looked at the "how it works" -- is there a way to manually specify leaf element sizing? Thinking about dynamically sized elements that don't have markup-level specified sizes yet via bounding boxes.
- Aejkatappaja 6mo agoThanks! Right now it relies entirely on getBoundingClientRect(), so if an element has no dimensions yet the block gets skipped. For images/videos I added a load event listener that re-measures once the media loads and takes up space. For elements that are truly dynamic with no initial size, the best workaround today is setting explicit dimensions via CSS (min-height, aspect-ratio, etc.) which is good practice for CLS anyway. That said, something like data-shimmer-width / data-shimmer-height attributes to manually override sizing could work well for that use case. Adding it to the backlog!