# @types/short-css-vars

> TypeScript definitions for short-css-vars

Latest version **1.1.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/short-css-vars
pnpm add @types/short-css-vars
yarn add @types/short-css-vars
bun add @types/short-css-vars
```

## Health

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

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2023-11-07 |
| First published | 2020-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51441 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/short-css-vars
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/short-css-vars
- npm.io page: https://npm.io/package/@types/short-css-vars

## Recent versions

- 1.1.3 (latest) — 2023-11-07
- 1.1.1 (ts3.6) — 2021-07-06
- 1.1.0 (ts3.1) — 2020-09-08
- 1.1.2 — 2023-10-18

## README

# Installation
> `npm install --save @types/short-css-vars`

# Summary
This package contains type definitions for short-css-vars (https://github.com/godaddy/short-css-vars/packages/short-css-vars#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/short-css-vars.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/short-css-vars/index.d.ts)
````ts
/**
 * Each instance keeps track of renamed variables to check for collisions and
 * to provide a mapping of changed names.
 *
 * @classdesc Shorten lengthy CSS variable names
 */
declare class ShortCssVars {
    constructor(options?: ShortCssVars.Options);

    /**
     * Shortens the name part of a variable string
     * @param varName - Variable name including -- prefix
     * @returns short
     */
    replaceName(varName: string): string;

    /**
     * Shortens the names of variables throughout CSS
     * @param css - Text containing CSS variables
     * @returns shortened CSS
     */
    replaceCss(css: string): string;

    /**
     * Get a mapping of original names to shortened names
     *
     * @example
     * {
     *   'long-variable-name-that-defines-a-particular-color': '1vf2dsn'
     * }
     * @returns map
     */
    getMap(): {
        [name: string]: string;
    };
}

declare namespace ShortCssVars {
    /**
     * Optional configurations
     */
    interface Options {
        /**
         * Custom formatter
         */
        formatter?: CustomFormatter | undefined;
        /**
         * Rule to ignore certain variable names
         */
        ignore?: IgnoreType | undefined;
    }

    interface CustomFormatter {
        /**
         * Returns a unique hash for a string name.
         *
         * @param name - Variable name
         * @returns encoded hash
         */
        (name: string): string;
    }

    interface CustomIgnore {
        (name: string): boolean;
    }

    type IgnoreType = RegExp | string | CustomIgnore;
}

export = ShortCssVars;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Piotr Błażejewicz](https://github.com/peterblazejewicz).

---
_Source: https://npm.io/package/@types/short-css-vars · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
