@tqman/ionic-color-injector
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Ionic Color Injector

Ionic Color Injector is a utility that injects ionic colors with generated css variables into the a html element at runtime.

Installation

  • via npm

    npm install @tqman/ionic-color-injector
  • via pnpm

    pnpm add @tqman/ionic-color-injector
  • via bun

    bun install @tqman/ionic-color-injector

Usage

import { injectIonicColor } from "@tqman/ionic-color-injector";

// this will inject a style element into the document's head
injectIonicColor("primary", "#428cff");

/* Expected Result

<html>
  <head>
    <style data-ion-color="primary">
      :root {
        --ion-color-primary: #428cff;
        --ion-color-primary-rgb: 66,140,255;
        --ion-color-primary-contrast: #000000;
        --ion-color-primary-contrast-rgb: 0,0,0;
        --ion-color-primary-shade: #3a7be0;
        --ion-color-primary-tint: #5598ff;
      }
    </style>
  </head>
  <body>...</body>
</html>
*/

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i @tqman/ionic-color-injector

    Weekly Downloads

    0

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    11.7 kB

    Total Files

    5

    Last publish

    Collaborators

    • tanishqmanuja