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

> The other question becomes when do we do `<my-button>` and when do we do `<button is="my-button">`?

(mostly as already mentioned  above, like in [Eric's post](https://github.com/w3c/webcomponents/issues/509#issuecomment-230780607))
As the author of `my-button` you prepare it to be 

- `<button is="my-button">`/`<template is="my-template">`/... - when
  - you need element's specific parsing context (`template`, `table`, `script`, `meta`,... dozens of others) ,
  - you need all native accessibility features,
  - you need all element-/parent-element-specific behavior without re-implementing it by your own (form serialization etc.),
  - you would like existing dev/SEO/automation/a11y/... HTML tools to understand that this will be `button`/`template`/... (by reading just HTML, w/o running JS in runtime)
  - you would like to use native/user-agent styles for `button`,
  - you would like to share your own/CSS framework styles for `button`
  - you need graceful fallback, in case you:
    - lazy-load element definition,
    - you will not provide element definition for some reason,
    - the element definition will fail due to any reason, 
  - express it clearly (via just HTML usage) to consumers of your `my-button` that they could expect the behavior of native element,

- `<my-button>` - when
  - you don't need any of above,
  - your element does not correspond to any native element other that `div`, `span`, etc.

I probably missed few other reasons, bu I think it's quite enough to express value of `is`.

-- 
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-264998062

Received on Monday, 5 December 2016 22:33:41 UTC