Git Product home page Git Product logo

component-template's Introduction

component-name

A Web Component for…

Demo | Further reading

Examples

General usage example:

<script type="module" src="component-name.js"></script>

<component-name>
  <button>Button</button>
</component-name>

Example using a fallback method:

<script type="module" src="component-name.js"></script>

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

Example using options or additional fallback method:

<script type="module" src="component-name.js"></script>

<component-name attribute="value">
  <button>Button</button>
</component-name>
<style>
  component-name[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 @daviddarnes/component-name
  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="component-name.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script
  type="module"
  src="https://www.unpkg.com/@daviddarnes/[email protected]/component-name.js"
></script>
<!-- 3rd party CDN, not recommended for production use -->
<script
  type="module"
  src="https://esm.sh/@daviddarnes/[email protected]"
></script>

Credit

With thanks to the following people:

component-template's People

Contributors

daviddarnes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

component-template's Issues

WebComponent doesn't work in Firefox

In Firefox the general example isn't shown while in Chrome all three examples are buttons. There is no fallbnack shown in Chrome.

Expected behaviour
I expect Firefox to show a button in the general examples and to not show buttons in Chrome in the steps two and three.

Screenshot

image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser FF
  • Version 121.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.