Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

skippy-links

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skippy-links

A small and easy to use web component to provide dynamic skip links to any page

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

<skippy-links> is a small and easy to use web component to provide dynamic skip links to any page, thus improving the website's accessibility

TOC

  1. What are skip links and why are they important
  2. How to use
  3. How to style
  4. How to contribute

Assistive technology users often have to tab through a long navigation until they get to the main content. This can be confusing and take a lot of time and energy.

Skip links are links that are placed before any other content and provide a way for assistive technology users to jump to the most important sections of the page, like for instance the main content, or even jump directly to a search input on the page.

Skip links seem like a minor improvement to the page, but they can make a huge difference for assistive technology users!

2. 🚀 How to use

Using the skippy-links is quite easy.

You just need to:

  • import it
  • add the <skippy-links></skip-links> to the page,
  • add the skippy-links-label="..." to any element you want to show on the skip links.

2.1 Install with npm

npm i skippy-links

2.2 Import into your project

<script src="skippy-links/skippy-links.js" type="module"></script>

2.3 Add to the page

The skippy-links element should be the first element on the body section of the page

<body>
    <skippy-links></skippy-links>
    <!-- Add your content after the <skip-links> element -->
</body>

You define which elements on the page you want to show on the skip links by giving them the skippy-links-label attribute.

For instance if you want to add a link to the <main> section with the "Main Content" label:

<main id="main" skippy-links-label="Main Content">
    <!-- your main content -->
</main>

Make sure the element also has an id!

3. 🎨 How to style

You can style the <skippy-links> element like any other element on your page.

The links inside it are on the shadow dom, so you can't style them directly, but you can use the following CSS variables:

Variabledefault value
--sl-color-primary#0000ee
--sl-element-height4rem
--sl-link-positionabsolute
--sl-link-top0
--sl-link-bottom0
--sl-link-left0
--sl-link-right0
--sl-link-width100%
--sl-link-heightvar(--sl-element-height)
--sl-link-displayflex
--sl-link-align-itemscenter
--sl-link-justify-contentcenter
--sl-link-colorvar(--sl-color-primary)
--sl-link-color-focusvar(--sl-color-primary)
--sl-link-color-hovervar(--sl-color-primary)
--sl-link-font-size1rem
--sl-link-text-decorationunderline
--sl-link-padding1rem
--sl-link-opacity1
--sl-link-opacity-focus1
--sl-link-opacity-hover1
--sl-link-transformtranslateY(-100%)
--sl-link-transform-focustranslateY(0)
--sl-link-transform-hovertranslateY(0)
--sl-link-box-sizingborder-box
--sl-link-transition-speed.25s
--sl-link-transition-speed-reduced-motion0

Example:

skippy-links {
    --sl-color-primary: red;
    --sl-link-opacity: .5;
}

4. ✏️ How to contribute

If you find any bugs or have any ideas on how to improve this component, please let us know at the skippy-links github

Keywords

FAQs

Package last updated on 09 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc