Re: [w3c/webcomponents] The is="" attribute is confusing? Maybe we should encourage only ES6 class-based extension. (#509)

 @hax thank you for your feedback

> 1. No declarative information in markups, so it's not easy to recognize CE, not only agents like search engines but also developers.

> 2. Attach behavior via stylesheets is rejected by many members of CSS WG, at least in year 1999 (I don't know what the current CSS experts thought.)

the question is, whats contained in this declaritive information. if a tool sees `is="something-fancy"` it only knows that maybe this element is targeted by a CustomElement, but what this customization does or if it actually exists, the tool cant infer. also the actual implementation of this CustomElement may very between different documents.

i totally get the reasoning for "dont but behavior in styling" thing and i partly agree.

> IMO, It's not clear how one element can have many behaviors attached, and how cascade mechanism works for behavior: add(xxx).

ofc this is something that has to be worked out

> Selectors can be very complex, someone may write customElements.define('.component-scope .parent-component.foo.bar > .my-button:not(:disabled)', MyButton) which is terrible and harm to performance. Of coz we can limit it, just like select attribute on content element in ShadowDOM V0, but I had to say such special rule is confusing.

`:not()` also has (had?) limitations, but people know selectors. its easier for them to begin. no need to learn the stuff about `tagName` and `extends`. people write the selector and know which elements get targeted or what has to be done to make an element match a specific selector. using classes is also a good way to integrate with server side CMSes that almost always allow (or have plugins) to attach classes to elements without custom templating. possible error messages are also very easy to understand: `You cant use the Selector Operator "+" in Custom Element Selector` And also as time and tech progress maybe this is a limitation that can be laxed out or completely removed in the future



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/509#issuecomment-301419861

Received on Monday, 15 May 2017 09:12:38 UTC