An open API service indexing awesome lists of open source software.

https://github.com/tram-one/html-import-element

Custom Element for adding a super simple way to import external HTML!
https://github.com/tram-one/html-import-element

Last synced: 9 months ago
JSON representation

Custom Element for adding a super simple way to import external HTML!

Awesome Lists containing this project

README

          

# html-import-element
Custom Element for adding a super simple way to import external HTML!

```html

```

## Install

Just include the following script in your page:
```html

```

## Features
- [x] Supports inline HTML
- [x] Supports inline CSS (`...`)
- [x] Supports external CSS (``)
- [x] Supports inline script (`...`)
- [x] Supports external script (``)

## Example

```html
<!-- title.html -->
<h1>HTML Imports are super cool!</h1>
```

```html
<!-- index.html -->
<html lang="en">
<head>
<script src="https://unpkg.com/html-import-element@1">




` will turn into:
```html

HTML Imports are super cool!

```

And that's it! Read the source code if you want to see what's going on, but we do a basic fetch, and then inject the content in the page.

## Development

You can run `npm start`, and navigate to the `/test` or `/example` pages, which validate and show the project use-cases.