You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bit silly feature idea: introduce optional import(s) (or JS generator in the "bookmarklet" include) emulating upcoming sibling-count() and sibling-index() proposal (by some @argyleink dude) in a brute-force ad-nauseam low-key manner:
Open question remains what initial threshold to pick (1-99?) and whether pre-generate further chunks (100-999, 1000-9999, ...?) in separate includes.
Most probably ideal alternative to includes in client-side environments with scripting available could be a dynamic JS polyfill with lazy mutation observer spitting out additional chunks into in-page <style> when maximum sibling count increases somewhere in the tree..
(*: I am consciously proposing zero-based indexing here as god intended, even though I clearly know it has zero-chance to be adopted this way; I just had to try 🙃. For 1-based property I'd propose --sibling-order. )
The text was updated successfully, but these errors were encountered:
From all my experiments there, I think it could be feasible to have reusable --sibling-index and --sibling-count up to ~100 elements. The --sibling-index requires only 19 rules to cover 99 elements, but the --sibling-count will need more if it will be using the ~ method. It is possible to make it more compact with :has(), but it is also much more performance-intensive — my article initially frozen Safari due to it.
The ~ method, though, seems pretty well optimized in all browsers, and has an excellent browser support. So if you don't need to write it from scratch and if it covers ~100 elements, that would be enough for most cases.
A bit silly feature idea: introduce optional import(s) (or JS generator in the "bookmarklet" include) emulating upcoming sibling-count() and sibling-index() proposal (by some @argyleink dude) in a brute-force ad-nauseam low-key manner:
--sibling-index
(*), and similarly
--sibling-count
or for super backwards ":has()-less" compatibility (or perhaps better performance(?)) the way Lea showcased in the distant past:
Open question remains what initial threshold to pick (1-99?) and whether pre-generate further chunks (100-999, 1000-9999, ...?) in separate includes.
Most probably ideal alternative to includes in client-side environments with scripting available could be a dynamic JS polyfill with lazy mutation observer spitting out additional chunks into in-page
<style>
when maximum sibling count increases somewhere in the tree..(*: I am consciously proposing zero-based indexing here as god intended, even though I clearly know it has zero-chance to be adopted this way; I just had to try 🙃. For
1
-based property I'd propose--sibling-order
. )The text was updated successfully, but these errors were encountered: