2.3.0 • Published 8 months ago

define-html v2.3.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

define-html

Define custom element to import in html

Motivation

When using vanilla HTML + CSS we sometimes want to split HTML on files but do not use powerful and hard solutions

Usage

Add link to preload external html file and define-html script in head:

<head>
    <!-- Other tags here -->
    <link rel="preload" href="app-content.html" as="fetch" crossorigin />
    <script src="https://unpkg.com/define-html" type="module"></script>
</head>

Where app-content.html is:

<template>
    Lorem ipsum
</template>

So later you can use include your template with:

<app-content></app-content>

Features

  • Read attribute values
  • Make conditional elements
  • Full slot support
  • Full style encapsulation
  • Optionally enable shadow root

Docs

TBD

License

Apache-2.0

2.3.0

8 months ago

2.2.1

8 months ago

2.1.0

8 months ago

2.0.0

8 months ago

1.10.0

8 months ago

1.9.0

8 months ago

1.8.2

9 months ago

1.8.1

9 months ago

1.8.0

9 months ago

1.7.0

9 months ago

1.6.1

9 months ago

1.6.0

9 months ago

1.5.0

9 months ago

1.4.0

9 months ago

1.3.0

9 months ago

1.2.0

9 months ago

1.1.0

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago