- From: Meteor0id via GitHub <sysbot+gh@w3.org>
- Date: Sat, 14 Apr 2018 17:07:44 +0000
- To: public-css-archive@w3.org
Meteor0id has just created a new issue for https://github.com/w3c/csswg-drafts:
== [selectors-5] add new selector immediate-adjecent-child ==
I am missing sort of the immediate sibling selector but for children instead of siblings.
Something like article ~> p
A theoretical article ~> p:first-of-type::first-letter would solve the following difficulty I encountered, for which I could come up with not other elegant method.
[https://jsfiddle.net/r0k0eoza/6/](https://jsfiddle.net/r0k0eoza/6/)
```
<div class="wrap_page">
<div class="some_other_wrapper">
<article>
<head>
<p>
This text should have its first letter selected
</p>
<p>
This text should NOT have its first letter selected
</p>
<main>
<p>
This text should NOT have its first letter selected
</p>
</main>
<p>
This text should NOT have its first letter selected
</p>
<p>
This text should NOT have its first letter selected
</p>
<section>
<p>
This text should NOT have its first letter selected
</p>
</section>
</head>
<footer>
<p>
This text should NOT have its first letter selected
</p>
</footer>
</article>
</div>
<footer>
<p>
This text should NOT have its first letter selected
</p>
</footer>
</div>
<article>
<p>
Just to be complete, this one should be selected
</p>
</article>
```
`.wrap_main p:first-of-type::first-letter, article p:first-of-type::first-letter {
color: red;
}`
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2568 using your GitHub account
Received on Saturday, 14 April 2018 17:07:54 UTC