- From: Adam Argyle via GitHub <sysbot+gh@w3.org>
- Date: Mon, 17 Jul 2023 16:44:39 +0000
- To: public-css-archive@w3.org
## Adding `child-count()`?
It would return the same value as `node.childElementCount`. Nothing CSS can do will change the value, but it would still be useful.
here's a subgrid demo that would benefit from `child-count()`
```css
main {
display: grid;
grid-template-columns: repeat(3, fit-content(var(--size-content-1)));
gap: var(--size-5);
& > .card {
display: grid;
/* this must be hand counted today and thus isn't dynamic and flexible to contents */
grid-row: span 4;
/* would be better dynamic, card.childElementCount = 4 */
grid-row: span child-count();
grid-template-rows: subgrid;
}
}
```
https://codepen.io/argyleink/pen/poQaXNx
--
GitHub Notification of comment by argyleink
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4559#issuecomment-1638503087 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 17 July 2023 16:44:41 UTC