1.6.0 • Published 6 months ago

header-logomenu v1.6.0

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

\

This webcomponent follows the open-wc recommendation.

Installation

npm i header-logomenu

Usage

<script type="module">
  import 'header-logomenu/header-logomenu.js';
</script>

<header-logomenu logo="/image/logo.png" logo-url="http://myurl.com">
  <nav>
    <ul>
      <li id="outer"></li>
      <li id="menu1">
        <button>MENU 1</button>
        <ul>
          <li id="linkA1"><a href="https://url-to-linkA1">Option 1 submenu 1</a></li>
          <li id="linkA2"><a href="https://url-to-linkA2" target="_blank">Option 2 submenu 1</a></li>
          <li id="linkA3"><a href="https://url-to-linkA3">Option 3 submenu 1</a></li>
          <li id="linkA4"><a href="https://url-to-linkA4">Option 4 submenu 1</a></li>
        </ul>
      </li>
      <li id="linkB"><a href="https://url-to-linkB">Option 3 menu</a></li>
      <li id="linkC"><a href="https://url-to-linkC">Option 4 menu</a></li>
      <li id="linkD"><a href="https://url-to-linkD">Option 5 menu</a></li>
    </ul>
  </nav>
  <a data-not-clone="outer" href="#outer" id="linkOUTER">OUTER</a>
</header-logomenu>
  /** CSS VARIABLES */
    --header-logomenu-height
    --header-logomenu-color-primary
    --header-logomenu-color-secondary
    --header-logomenu-color-dark
    --header-logomenu-text-color
    --header-logomenu-logo-height
    --header-logomenu-background-color
    --header-logomenu-border
    --header-logomenu-menu-background-color
    --header-logomenu-submenu-background-color
    --header-logomenu-menu-color
    --header-logomenu-submenu-color
    --header-logomenu-background-color-selected
    --header-logomenu-color-bar
    --header-logomenu-element-hover-border
    --header-logomenu-element-hover-background-color
    --header-logomenu-element-hover-border-radius
    --header-logomenu-justify-content

Cloned and not cloned elements

The nav tag is cloned into the shadow Root, adding encapsulated CSS classes and events.

All elements outside the nav tag are not cloned.

All elements with the attribute data-not-clone are not cloned, but it moves to shadow Root if a nav element has the id of the data-not-cloned attribute. For example de a tag with data-not-clone="outer" is moved to shadow Root because the nav tag has an element with id outer.

Linting and formatting

To scan the project for linting and formatting errors, run

npm run lint

To automatically fix linting and formatting errors, run

npm run format

Testing with Web Test Runner

To execute a single test run:

npm run test

To run the tests in interactive watch mode run:

npm run test:watch

Demoing with Storybook

To run a local instance of Storybook for your component, run

npm run storybook

To build a production version of Storybook, run

npm run storybook:build

Tooling configs

For most of the tools, the configuration is in the package.json to minimize the amount of files in your project.

If you customize the configuration a lot, you can consider moving them to individual files.

Local Demo with web-dev-server

npm start

To run a local development server that serves the basic demo located in demo/index.html

1.5.5

6 months ago

1.3.7

7 months ago

1.5.4

7 months ago

1.5.3

7 months ago

1.5.2

7 months ago

1.6.0

6 months ago

1.5.1

7 months ago

1.5.0

7 months ago

1.4.0

7 months ago

1.5.8

6 months ago

1.5.7

6 months ago

1.3.9

7 months ago

1.5.6

6 months ago

1.3.8

7 months ago

1.3.6

9 months ago

1.3.5

9 months ago

1.3.4

9 months ago

1.3.3

9 months ago

1.3.2

9 months ago

1.3.1

9 months ago

1.3.0

9 months ago

1.2.2

10 months ago

1.2.1

10 months ago

1.2.0

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago