deco-spoiler-tag

1.0.1 • Public • Published

deco-spoiler-tag

Spoiler Tag Web Component written in Tram-Deco

text "Thorn shouts to the surrounding crowd," and then there is black bar where there should be text

Live Example on Codepen

How to use

<script src="https://unpkg.com/deco-spoiler-tag@1"></script>

<p>
  Thorn shouts to the surrounding crowd,
  <spoiler-tag>"Soylent Green is people!"</spoiler-tag>
</p>

API

The component takes in a single slot, which is the hidden content.

You can style the control for the spoiler using ::part(control)::after.

<style>
  spoiler-tag::part(control)::after {
    background: green;
    color: green;
  }
</style>

Package Sidebar

Install

npm i deco-spoiler-tag

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

8.55 kB

Total Files

6

Last publish

Collaborators

  • jrjurman