@chrisburnell/inline-expand

0.0.2 • Public • Published

inline-expand

A Web Component for expanding inline content.

Demo | Further reading

Examples

General usage example:

<script type="module" src="inline-expand.js"></script>

<inline-expand>
  <button>Button</button>
</inline-expand>

Example using a fallback method:

<script type="module" src="inline-expand.js"></script>

<inline-expand>
  <button>Button</button>
  <a href="#">Anchor</a>
</inline-expand>
<style>
  inline-expand:not(:defined) button,
  inline-expand:defined a {
    display: none;
  }
</style>

Example using options or additional fallback method:

<script type="module" src="inline-expand.js"></script>

<inline-expand attribute="value">
  <button>Button</button>
</inline-expand>
<style>
  inline-expand[attribute="value"] {
    outline: 1px solid red;
  }
</style>

Features

This Web Component allows you to:

  • Check for…

Installation

You have a few options (choose one of these):

  1. Install via npm: npm install @chrisburnell/inline-expand
  2. Download the source manually from GitHub into your project.
  3. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)

Usage

Make sure you include the <script> in your project (choose one of these):

<!-- Host yourself -->
<script type="module" src="inline-expand.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script
  type="module"
  src="https://www.unpkg.com/@chrisburnell/inline-expand/inline-expand.js"
></script>
<!-- 3rd party CDN, not recommended for production use -->
<script
  type="module"
  src="https://esm.sh/@chrisburnell/inline-expand"
></script>

Credit

With thanks to the following people:

Package Sidebar

Install

npm i @chrisburnell/inline-expand

Weekly Downloads

25

Version

0.0.2

License

MIT

Unpacked Size

9.67 kB

Total Files

8

Last publish

Collaborators

  • chrisburnell