# vscode-ext-decoration

> VS Code Decoration helper functions

Latest version **1.1.0** (published 2022-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install vscode-ext-decoration
pnpm add vscode-ext-decoration
yarn add vscode-ext-decoration
bun add vscode-ext-decoration
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-02-24 |
| First published | 2020-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alessandro Fragnani |
| Maintainers | alefragnani |
| Keywords | vscode, decoration |

## Links

- npm: https://www.npmjs.com/package/vscode-ext-decoration
- Repository: https://github.com/alefragnani/vscode-ext-decoration
- Homepage: https://github.com/alefragnani/vscode-ext-decoration#readme
- Issues: https://github.com/alefragnani/vscode-ext-decoration/issues
- npm.io page: https://npm.io/package/vscode-ext-decoration

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-02-24
- 1.0.0 — 2020-02-05

## README

# vscode-ext-decoration

This module contains a set of helper functions to work with **Decorations** while developing VS Code extensions.

## Installation

`npm install vscode-ext-decoration`

## Usage

```ts
    import { createLineDecoration, createGutterDecoration } from "vscode-ext-decoration";

    ...

    // regular file from disk
    const pathIcon = context.asAbsolutePath("images/bookmark.svg");    
    // building a SVG on the fly
    const pathIcon = Uri.parse(
        `data:image/svg+xml,${encodeURIComponent(
            `<?xml version="1.0" ?><svg height="16px" version="1.1" viewBox="0 0 16 16" width="16px" 
            xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" 
            xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" 
            id="Page-1" stroke="none" stroke-width="1"><g fill="#157EFB" id="icon-18-bookmark">
            <path d="m6.6319,2.13334c-0.82764,0 -1.49857,0.67089 -1.49857,1.49555l0,10.50444l2.99999,-3l3,3l0,-10.50444c0,
            -0.82597 -0.67081,-1.49555 -1.49858,-1.49555l-3.00285,0z" id="bookmark"/></g></g></svg>`,
        )}`,
    );
    const backgroundColor: string = vscode.workspace.getConfiguration("bookmarks").get("backgroundLineColor", "");

    const decor = createLineDecoration(backgroundColor, "rgba(0, 255, 0, 0.5)", vscode.OverviewRulerLane.Full, "rgba(21, 126, 251, 0.7)", pathIcon);
```

## Support

If you find it useful, please consider supporting it.

<table align="center" width="60%" border="0">
  <tr>
    <td>
      <a title="Paypal" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EP57F3B6FXKTU&lc=US&item_name=Alessandro%20Fragnani&item_number=vscode%20extensions&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif"/></a>
    </td>
    <td>
      <a title="Paypal" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EP57F3B6FXKTU&lc=BR&item_name=Alessandro%20Fragnani&item_number=vscode%20extensions&currency_code=BRL&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"><img src="https://www.paypalobjects.com/pt_BR/i/btn/btn_donate_SM.gif"/></a>
    </td>
    <td>
      <a title="Patreon" href="https://www.patreon.com/alefragnani"><img src="https://raw.githubusercontent.com/alefragnani/oss-resources/master/images/button-become-a-patron-rounded-small.png"/></a>
    </td>
  </tr>
</table>

# License

[MIT](LICENSE.md) &copy; Alessandro Fragnani

---
_Source: https://npm.io/package/vscode-ext-decoration · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
