/ archiveofbelonging.org / back / node_modules / icss-utils /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]lib/2 years ago -  
[TXT]LICENSE.md40 years ago744 7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك]
[TXT]README.md40 years ago1.8Kf12eb36 documentaiton updates [كارل مبارك]
[   ]package.json2 years ago2.4K7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك]
README.md

Build Status

ICSS Utils

replaceSymbols

Governs the way tokens are searched & replaced during the linking stage of ICSS loading.

This is broken into its own module in case the behaviour needs to be replicated in other PostCSS plugins (i.e. CSS Modules Values)

import { replaceSymbols, replaceValueSymbols } from "icss-utils";

replaceSymbols(css, replacements);
replaceValueSymbols(string, replacements);

Where:

A symbol is a string of alphanumeric, - or _ characters. A replacement can be any string. They are replaced in the following places:

extractICSS(css, removeRules = true)

Extracts and remove (if removeRules is equal true) from PostCSS tree :import and :export statements.

import postcss from "postcss";
import { extractICSS } from "icss-utils";

const css = postcss.parse(`
  :import(colors) {
    a: b;
  }
  :export {
    c: d;
  }
`);

extractICSS(css);
/*
  {
    icssImports: {
      colors: {
        a: 'b'
      }
    },
    icssExports: {
      c: 'd'
    }
  }
*/

createICSSRules(icssImports, icssExports)

Converts icss imports and exports definitions to postcss ast

createICSSRules(
  {
    colors: {
      a: "b"
    }
  },
  {
    c: "d"
  }
);

License

ISC


Glen Maddern, Bogdan Chadkin and Evilebottnawi 2015-present.

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80