[whatwg] A link[scoped] usecase

(12/03/02 23:35), Tab Atkins Jr. wrote:
> Do this instead:
>
> <div>
>   <style scoped>
>     @import "3rd-party-theme/user-published-20120302133702.css";
>   </style>
>   <span class="keyword">function</span><span> class="identifier">test</span>...
> </div>
>
> ~TJ

On the other hand, why is it bad for browsers and the Web platform to
support @scoped on <link>?

I talked to Hixie on IRC[1] and he seems to think that there's no use
case for <style>@import</style> either. So, is the scenario here a valid
use case for <style>@import</style>? If it is, why is it bad to add
@scoped to <link> again when this solution is somewhat subtle and can be
only considered a hack?

The argument here is that I think <style>@import</style> might have
usability problem (and also you need more work if want to switch the
style. This could happen, for example, when the theme panel as described
in this use case is a <div> with a <select>.). A reader of html5doctor
had the same problem too[2] and I can certainly image other people being
confused by this.

[1] http://krijnhoetmer.nl/irc-logs/whatwg/20120302#l-166
[2] http://html5doctor.com/the-scoped-attribute/#link


Cheers,
Kenny

Received on Friday, 2 March 2012 10:03:51 UTC