- From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
- Date: Fri, 31 Aug 2012 17:18:15 +0400
- To: Brian Kardell <bkardell@gmail.com>
- Cc: fantasai <fantasai.lists@inkedblade.net>,"www-style@w3.org" <www-style@w3.org>
31.08.2012, 03:46, "Brian Kardell" <bkardell@gmail.com>:
> On Aug 30, 2012 7:38 PM, "fantasai" <fantasai.lists@inkedblade.net> wrote:
>>
>> The CSS WG has published an updated Working Draft of the Selectors Level 4:
>>
>> š š http://www.w3.org/TR/selectors4/
> Since I got no response last time I will try again....
> :has() ... please?š Reading the past minutes I do not see to be alone in my support... it is honestly a lot less confusing and already proven.
Indeed, `:has()` would make HTML code more clear from extra elements and extra classes.
For example, we have a table where some cells contain links clickable over entire area (including padding) while other cells contain just text:
    <table>
        <tr>
            <td>1</td>
            <td><a href="#">2</a></td>
        </tr>
    </table>
and we want that all cells have `em` padding, we are currently forced to wrap text with `SPAN`:
    <table>
        <tr>
            <td><span>1</span></td>
            <td><a href="#">2</a></td>
        </tr>
    </table>
    <style>
        TD > A,
        TD > SPAN {display: block; padding: .1em .3em; }
    </style>
We can't use negative margins to compensate cell padding:
    <table>
        <tr>
            <td>1</td>
            <td><a href="#">2</a></td>
        </tr>
    </table>
    <style>
        TD,
        TD > A {padding: .1em .3em; }
        TD > A {display: block; margin: -.1em -.3em; }
    </style>
since it wouldn't be pixel-perfect (calculated pixel value of `em` value varies depending on calculated pixel dimensions of previous elements).
Received on Friday, 31 August 2012 13:18:44 UTC