[w3c/webcomponents] Using slot="" attribute on <link rel="import"> (Imports without JavaScript) (#636)

I suppose this is somewhat a proposal, but I'm also wondering whether this is a good idea if I were to make it possible with JavaScript…

The documentation available for the `slot` attribute indicates that this attribute may be placed on any element. In the interest of working with partials loaded via `<link rel="import">`, I'm wondering whether the `slot` attribute with its associated `<slot>` element could be used to simplify the placement of partials by only needing to write declarative HTML:

```
<html>
  <head>
    <link rel="import" href="partial.html" slot="partial" />
  </head>
  <body>
    <slot name="partial">No content found.</slot>
  </body>
</html>

```

…whereby `<body>` is acting as a Shadow DOM for imports.

Are there potential problems with doing this that I'm not seeing?

It seems to me that having to require JavaScript for basic compositional functionality is overkill. Has the possibility of enabling HTML imports for basic composition — without requiring authors to write and users to load JavaScript — been considered?

-- 
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/636

Received on Sunday, 16 April 2017 14:17:54 UTC