Re: A *:body pseudo class

Hi,

I’ve often thought that ::surround and ::contain as pseudo-elements would be useful.

i.e. ::surround would (effectively) change:

<div>Text</div>

…to:

<newelement><div>Text</div></newelement>

…and ::contain would (effectively) change:

<div>Text</div>

…to:

<div><newelement>Text</newelement></div>

This would enable us to take all those crufty divs and spans that we just need for presentational hooks, and move them into the presentation layer where they belong.

Is there already something to achieve this that I’m unaware of? Thoughts?

A

On 31 Jan 2014, at 07:18, Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> wrote:

> Matthew Robb, Thu, 30 Jan 2014 22:21:13 -0800:
>> Why not do something like this as a pseudo-element that works like ::before
>> and ::after but more like ::wrap ?
>> 
>> 
>> On Thu, Jan 30, 2014 at 9:39 PM, Leif Halvard Silli wrote:
>> 
>>> Leif Halvard Silli, Fri, 31 Jan 2014 06:35:32 +0100:
>>>> Given that it ought to be a universal pattern that body text follows
>>>> *after* headings, I am hereby proposing a *:body pseudo class.
>>> 
>>> Or, to shed some bike on the issue: *:body-text, so as to avoid linking
>>> it to the body element.
> 
> Hi Matthew. May be a pseudo-element, and not a pseudo-class, is what is 
> needed. However, I actually think *not*. 
> 
> I think psudo-*class* is what we should have. Because, a pseudo element 
> is placed at the start or at the end of an element. But I propose 
> something that encapsulate the entire "body text". Thus, a selector to 
> match content that is *already there*. And not a selector to *add* any 
> new content.
> 
> Leif Halvard Silli
> 

Received on Friday, 31 January 2014 15:11:53 UTC