Patrick H. Lauke on Nostr: PSA: `:only-child`. `:last-child`, `:first-child` in #css ignore text nodes ... so if ...
PSA: `:only-child`. `:last-child`, `:first-child` in #css ignore text nodes ... so if you have something like `<li>some text <a href="#">and a link</a></li>` but you're trying to only target list items that ONLY contain a link and nothing else, `li > a:only-child` will still apply to the above...
https://codepen.io/patrickhlauke/pen/xxeNzvwPublished at
2024-05-01 13:42:20Event JSON
{
"id": "69fd044cbeb637e2c2a61e74965c862ff9789710539a06f854000ac070eb4ba1",
"pubkey": "d70cb691c0e8f6bdba7892f2e9b15c08525743b9d92f8b0f7c6fbd1af05ff751",
"created_at": 1714570940,
"kind": 1,
"tags": [
[
"t",
"css"
],
[
"proxy",
"https://mastodon.social/users/patrick_h_lauke/statuses/112366121175332099",
"activitypub"
]
],
"content": "PSA: `:only-child`. `:last-child`, `:first-child` in #css ignore text nodes ... so if you have something like `\u003cli\u003esome text \u003ca href=\"#\"\u003eand a link\u003c/a\u003e\u003c/li\u003e` but you're trying to only target list items that ONLY contain a link and nothing else, `li \u003e a:only-child` will still apply to the above...\n\nhttps://codepen.io/patrickhlauke/pen/xxeNzvw",
"sig": "123fcb1e6920055c7d7f05b77ca955de6bfd81767393c9b53730ae3944b24f0ba3e2b2bbaa042b38690e912c6462a4a1002b9fe5dfe8389ede925829beba4336"
}