Skip to content

Kiricon/top-nav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

top-nav

An HTML custom element implementing the <top-nav> element.

top-nav in action

Setup

Installation

npm i top-nav

<script src="node_modules/top-nav/top-nav.js"></script>

or if you're bundling

import "top-nav";
// or
require("top-nav");

Usage

<top-nav>
    <!-- Your content here -->
</top-nav>

Customization

You can customize the color of the top-nav by assigning values to css elements.

The CSS custom properties that affect top-nav are --top-nav-color, --primary-color, --top-nav-padding, --top-nav-text-color.

You can set there values like so

    :root {
        --top-nav-color: red; /* if both are set --top-nav-color takes precedence */
        --primary-color: red; 
        --top-nav-padding: 30px; /* (optional) defaults to 20px */
        --top-nav-text-color: black; /* (optional) defaults to white */
    }

About

A top navigation vanilla custom element

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published