Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ideas:pseudo-elements [2012/02/15 08:37] astearnsideas:pseudo-elements [2017/01/27 12:16] (current) bkemper
Line 3: Line 3:
 The ::outside pseudo-element was cut from css3-content and has not been tracked since. Other pseudo-elements concepts like wrapping a range of elements have been discussed from time to time. Additional pseudo-elements with more control over where they are positioned in the tree could help reduce markup clutter where elements are added to HTML for the sole purpose of CSS styling ([[http://lists.w3.org/Archives/Public/www-style/2011Dec/0463.html|Markup Clutter thread]]) ([[http://lists.w3.org/Archives/Public/www-style/2010Jul/0160.html|Thread discussing wrapping multiple elements]]). See also: [[http://lists.w3.org/Archives/Public/www-style/2012Feb/0193.html|cross-post from whatwg about anonymous grouping]]. The ::outside pseudo-element was cut from css3-content and has not been tracked since. Other pseudo-elements concepts like wrapping a range of elements have been discussed from time to time. Additional pseudo-elements with more control over where they are positioned in the tree could help reduce markup clutter where elements are added to HTML for the sole purpose of CSS styling ([[http://lists.w3.org/Archives/Public/www-style/2011Dec/0463.html|Markup Clutter thread]]) ([[http://lists.w3.org/Archives/Public/www-style/2010Jul/0160.html|Thread discussing wrapping multiple elements]]). See also: [[http://lists.w3.org/Archives/Public/www-style/2012Feb/0193.html|cross-post from whatwg about anonymous grouping]].
  
-Another issue is that there is very little scripting access to pseudo-elements currently. If we end up relying on pseudo-elements for wrappers or for inserting presentational boxes there should be a way to attach event handlers to pseudo-elements: [[http://lists.w3.org/Archives/Public/www-style/2012Feb/0626.html|post with use cases for interaction in layout]]+One issue is that there is very little scripting access to pseudo-elements currently. If we end up relying on pseudo-elements for wrappers or for inserting presentational boxes there should be a way to attach event handlers to pseudo-elements: [[http://lists.w3.org/Archives/Public/www-style/2012Feb/0626.html|post with use cases for interaction in layout]] 
 + 
 +Another issue is how to provide a way to override pseudo-element styling. If one stylesheet defines a pseudo-element wrapper with some styling, how can a second stylesheet import the first and override the wrapper's style?
  
 Here is a list of possible pseudo-element additions that could be made in a future spec. Here is a list of possible pseudo-element additions that could be made in a future spec.
Line 93: Line 95:
   <!-- ::before pseudo-element 2 -->   <!-- ::before pseudo-element 2 -->
   markup content   markup content
 +</div>
 +</code>  
 +
 +<code css>
 +div::before {border: thick solid green; content="text1";}
 +div::before::before {border: thick solid lime; content="text2";}
 +div::after {border: thick solid green; content="text3";}
 +div::after::after {border: thick solid lime; content="text4";}
 +</code>
 +<code html>
 +<div>
 +  <!-- ::before pseudo-element -->
 +    <!-- nesting ::before pseudo-element -->
 +      text2
 +    <!-- end -->
 +    text1
 +  <!-- end -->
 +  markup content
 +  <!-- ::after pseudo-element -->
 +    text3
 +    <!-- nesting ::after pseudo-element -->
 +      text4
 +    <!-- end -->
 +  <!-- end -->
 </div> </div>
 </code>   </code>  
 
ideas/pseudo-elements.txt · Last modified: 2017/01/27 12:16 by bkemper
Recent changes RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki