open-stories-element

<open-stories>

An OpenStoriesFeed viewer. See it in action on muan.co.

WIP

Things yet to be supported:

Usage

<!-- Include `OpenStoriesElement` -->
<script src="https://unpkg.com/[email protected]" type="module" defer></script>

<!-- Render `<open-stories>` -->
<open-stories src="./feed.json"></open-stories>

This requires native <dialog> and Shadow DOM support. No polyfills included.

Parts

Style elements with ::part (MDN):

Button

open-stories::part(button) is the selector for the <button> that opens the story modal. It would be good to style open-stories:not(:defined) the same way, to prevent style flashing as the script executes.

Advanced

Button text / <slot>

Whatever you put inside <open-stories>HERE</open-stories> will replace the default button text “View Stories”. (MDN)

Attributes

Classes