1.0.2 • Published 1 year ago

@annoyingmouse/wc-trim-middle v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Shamelessly stolen from Christian Heilmann this takes his function and embeds it into a Web Component without a shadowDOM, according to Mr Heilmann:

The original text is retained in the title attribute of the element, but only if the string has been trimmed.

Usage

<span is="wc-trim-middle">This is a long string that will be trimmed</span>
<script type="module" src="wc-trim-middle.js"></script>

Configuration

  • Adding a width attribute allow you to define the amount of letters you want to show - it defaults to 16.
  • Adding a replacement attribute allows you to change what the character in between the parts should be - it defaults to .

License

MIT

1.0.2

1 year ago

1.0.1

1 year ago