- From: fantasai <fantasai.lists@inkedblade.net>
- Date: Tue, 20 Sep 2011 16:59:26 -0700
- To: www-style@w3.org
On 09/19/2011 04:12 PM, fantasai wrote: > On 09/19/2011 03:58 PM, Tab Atkins Jr. wrote: >> Summary >> ------- >> HTML is defining <style scoped> in a way which best matches author >> intuitions, but which is limited in some ways. I propose @global as a >> way to get around those limitations while maintaining the >> intuitiveness benefits. Hixie wrote an email explaining the relevant >> reasoning and suggesting this proposal at >> <http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033222.html>. > > What's the use case for this, i.e. do we actually need to solve this problem? Hixie gave some good use cases here: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-June/032057.html From the use cases it seems to me the idea is not "make this match across the entire tree and filter the results" but rather "here I want to match against some contextual information that's outside my scope". So, given that, rather than having a "scoped vs. global" switch, how about using a pseudo-class to distinguish whether a portion of the selector is matching out-of-scope elements? E.g. <style scoped> section > h1 { border-bottom: solid; } :context(body.homepage) h1 { color: red; } :context(body.archive) h1 { color: gray; } </style> ~fantasai
Received on Tuesday, 20 September 2011 23:59:54 UTC