Re: Custom Elements: is=""

On 13/06/2015 16:33, Bruce Lawson wrote:
> On 13 June 2015 at 15:30, LĂ©onie Watson <lwatson@paciellogroup.com> wrote:
>> why not use the extends= syntax you mentioned?
>>
>> <my-button extends="button" attributes>Push</my-button>
>
> because browsers that don't know about web components wouldn't pay any
> attention to <my-button>, and render "Push" as plain text.
>
>   Browsers that don't know about web components will fall back to
> <button> with <button
> this-is-made-much-more-marvellous-by="my-button"> (or whatever)

However, this fallback will only really be useful for very simple cases, 
where web components have been used to jazz up what essentially is still 
the element that was extended. And, I would posit, any scripting that 
was done to act on the all-singing, all-dancing new web component button 
(if it does anything more than a regular button) would not work for the 
fallback. Unless it's really just using web components for fancy styling 
(for instance having a "material design" button that essentially still 
works just like a button) - in which case, it makes more sense to work 
on stylability of standard elements.

P
-- 
Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke

Received on Sunday, 14 June 2015 00:41:58 UTC