This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19897 - [Shadow]: Add Custom Pseudo-Elements example
Summary: [Shadow]: Add Custom Pseudo-Elements example
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18428
  Show dependency treegraph
 
Reported: 2012-11-07 20:03 UTC by miket
Modified: 2012-12-04 06:56 UTC (History)
1 user (show)

See Also:


Attachments

Description miket 2012-11-07 20:03:15 UTC
Section 5.10 Custom Pseudo-Elements could do with a code example to clarify how it all works. As an author, the mechanics aren't crystal clear--and there isn't any mention in the Explainer.

Going with the example of the 2-dimensional range slider widget, is the following enough to actually create the custom pseudo-element for the slider thumb, called "x-slider-thumb"?

var thumb = shadowRoot.getElementById('slider-thumb')
thumb.pseudo = "x-slider-thumb"

And then I can use it in my page's stylesheet like so,

:x-slider-thumb {background-color: rgba(0,0,0,.75)}

I might have it wrong, but a correct example would be helpful here.
Comment 1 Dimitri Glazkov 2012-11-07 20:50:47 UTC
Word.
Comment 2 Sergey G. Grekhov 2012-11-29 05:24:33 UTC
I vote for the example too.
Comment 3 Dimitri Glazkov 2012-12-03 16:46:18 UTC
http://dvcs.w3.org/hg/webcomponents/rev/76e968e547e9
Comment 4 miket 2012-12-03 16:52:49 UTC
Great!
Comment 5 Sergey G. Grekhov 2012-12-04 06:56:24 UTC
Thank you! See also implementation issue https://bugs.webkit.org/show_bug.cgi?id=103973