I'm on the fence. <style scoped> seems like a reasonable way for sites to avoid having a large number of global style rules without needing to go fully down the much more complicated codepath of web components + shadow roots.
Yes, so is this feature simply saving putting that ID in every selector? If so, it feels like selector nesting (which developer also want) would satisfy this and more.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
+1 to remove <style scoped>. I agree that style scoped makes Blink much more complex.However, I have one concern. Firefox has already implemented style scoped.I'm not sure whether web developers will love style scoped or not.
On Tuesday, November 19, 2013 11:19:40 AM UTC, Takashi Sakamoto wrote:+1 to remove <style scoped>. I agree that style scoped makes Blink much more complex.However, I have one concern. Firefox has already implemented style scoped.I'm not sure whether web developers will love style scoped or not.Speaking as a developer, I think it's a useful feature for quick prototyping and ad-hoc collaboration on documents written in HTML, but not one that is going to revolutionise my workflow. Its primary appeal is that it reduces cognitive load and is reasonably intuitive. If I'm maintaining some internal documentation in HTML, and I need to add a section to it, I can write the markup and the styles together and stick 'em in a document, knowing I don't need to worry about breaking other content, or colliding with an existing id, or someone else colliding with my id later. Given the choice, I would rather have selector nesting in CSS than scoped styles, but I don't believe we'll get nested selectors for many years, if ever, regardless of whether scoped styles are removed, so that isn't really an alternative, IMO.I think the key thing with scoped styles is that their primary use-case is the opposite of web components. The component APIs are intended for professional developers building well-engineered applications, but there has always been a large constituency of HTML authors who are not professionals, and for whom a requirement to use imports and shadow DOM would be overkill. Scoped style provides a simple way for them to write CSS that restricted to its target content and associated to it via proximity.
On Tue, Nov 19, 2013 at 8:29 AM, Jon Rimmer <jon.r...@gmail.com> wrote:
On Tuesday, November 19, 2013 11:19:40 AM UTC, Takashi Sakamoto wrote:+1 to remove <style scoped>. I agree that style scoped makes Blink much more complex.However, I have one concern. Firefox has already implemented style scoped.I'm not sure whether web developers will love style scoped or not.Speaking as a developer, I think it's a useful feature for quick prototyping and ad-hoc collaboration on documents written in HTML, but not one that is going to revolutionise my workflow. Its primary appeal is that it reduces cognitive load and is reasonably intuitive. If I'm maintaining some internal documentation in HTML, and I need to add a section to it, I can write the markup and the styles together and stick 'em in a document, knowing I don't need to worry about breaking other content, or colliding with an existing id, or someone else colliding with my id later. Given the choice, I would rather have selector nesting in CSS than scoped styles, but I don't believe we'll get nested selectors for many years, if ever, regardless of whether scoped styles are removed, so that isn't really an alternative, IMO.I think the key thing with scoped styles is that their primary use-case is the opposite of web components. The component APIs are intended for professional developers building well-engineered applications, but there has always been a large constituency of HTML authors who are not professionals, and for whom a requirement to use imports and shadow DOM would be overkill. Scoped style provides a simple way for them to write CSS that restricted to its target content and associated to it via proximity.I feel like i have to interject here: web components are not only meant for "professionals", they're meant for everyone. I expect many devs to just take a few they found on html5rocks, css-tricks, or wherever and just pop them in a page. That they appear via HTML Imports and not script src is just a detail. That they may or may not have Shadow DOM is not something I expect many devs to care about whatsoever, because they are self-contained little blobs.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Scope styles are good for letting commenters add their style that will only affect their comments. More creative freedom.
Theoretically yes, you can implement that way.Then the implementation sacrifices some performance, if implemented naively.The selector matching logic can be optimized, but naive implementation would try to matchscoped rules against out-of-scope DOM elements which will always fail to match.
Other complication is related to co-existence of Shadow DOM style, which is also scoped.The previous implementation tried to solve both in a unified manner, which resulted incomplexity and the <style scoped> part was removed.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
What if the ID that the element already has is not really unique (disallowed, but happens)?
We are not saying that we will never implement <style scoped>,we just removed the code for some reasons.We may re-implement it in the future.
That is why I purpose a "simple" way to do it ;)No complex new logic, no new rules and all this compatible with the W3C specifications.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.