@oddbird/css-toggles

1.1.0 • Public • Published

CSS Toggles preview

Polyfill Installation

Download a copy

The simplest, recommended way to install the polyfill is to copy it into your project.

Download css-toggles.min.js from unpkg.com and add it to the appropriate directory in your project. Then, include it where necessary with a <script> tag:

<script src="/path/to/css-toggles.min.js" type="module"></script>

You can also use an IIFE version if your target browsers require it:

<script src="/path/to/css-toggles.iife.min.js"></script>

With npm

For more advanced configuration, you can install with npm:

npm install @oddbird/css-toggles

After installing, you’ll need to use appropriate tooling to use node_modules/@oddbird/css-toggles/dist/css-toggles.js (or .min.js).

Via CDN

For prototyping or testing, you can use the npm package via a Content Delivery Network. Avoid using JavaScript CDN’s in production, for many good reasons such as performance and robustness.

<script
  src="https://cdn.jsdelivr.net/npm/@oddbird/css-toggles@latest"
  crossorigin="anonymous"
  defer
></script>

Usage

After installation the polyfill will automatically parse all stylesheets present in the HTML document (both inline and linked) for the proposed CSS Toggles syntax. Once the styles are parsed the toggling behavior will be polyfilled with JavaScript.

Contributing

Visit our contribution guidelines.

Readme

Keywords

Package Sidebar

Install

npm i @oddbird/css-toggles

Weekly Downloads

112

Version

1.1.0

License

BSD-3-Clause

Unpacked Size

57.6 kB

Total Files

9

Last publish

Collaborators

  • jerivas
  • mirisuzanne
  • jgerigmeyer