1
mirror of https://github.com/jakejarvis/simple-anchor.git synced 2025-04-28 06:20:28 -04:00
dependabot[bot] 27b37d0c4d
Bump http-cache-semantics from 4.1.0 to 4.1.1
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-03 23:14:29 +00:00
2021-08-30 13:48:58 -04:00
2021-08-30 13:24:15 -04:00
2021-08-30 13:24:15 -04:00
2021-08-30 13:24:15 -04:00
2021-08-30 19:31:46 -04:00

🔗 Simple Anchor

CI npm MIT License

A JavaScript utility for adding deep anchor links (like these) to existing page content. Zero dependencies and only ~1kB gzipped!

Changes from AnchorJS

  • Styling of .anchorjs-link elements is completely on you. The non-optional and hefty base styles of AnchorJS have been removed for a slimmer module. (This includes the default 🔗 icon.)
  • Element IDs are also left to you — this package will not generate an element's ID automatically if one is not already set (eg. <h2 id="installation">Installation</h2>). Elements without one are automatically ignored.

Otherwise, the AnchorJS docs still serve as a good reference.

Usage

Browser

<script src="https://unpkg.com/simple-anchor/dist/simple-anchor.min.js"></script>
<script>
  var anchor = new SimpleAnchor();
  anchors.add({
   icon: '#'
  });
</script>

Node

npm install simple-anchor
# or...
yarn add simple-anchor
import SimpleAnchor from 'simple-anchor';
// or...
// const SimpleAnchor = require('simple-anchor');

const anchors = new SimpleAnchor();
anchors.add({
   icon: '#'
});

Since AnchorJS's default CSS has been removed as mentioned above, it's up to you to style the .anchorjs-link element.

Examples

License

MIT

Languages
JavaScript 100%