Gathering detailed insights and metrics for icss-utils
Gathering detailed insights and metrics for icss-utils
Gathering detailed insights and metrics for icss-utils
Gathering detailed insights and metrics for icss-utils
npm install icss-utils
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
22 Stars
67 Commits
15 Forks
5 Watchers
39 Branches
15 Contributors
Updated on Jan 04, 2025
Latest Version
5.1.0
Package Id
icss-utils@5.1.0
Size
3.93 kB
NPM Version
6.14.8
Node Version
12.19.0
Published on
Nov 19, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
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)
1import { replaceSymbols, replaceValueSymbols } from "icss-utils";
2
3replaceSymbols(css, replacements);
4replaceValueSymbols(string, replacements);
Where:
css
is the PostCSS tree you're working withreplacements
is an JS object of symbol: "replacement"
pairs, where all occurrences of symbol
are replaced with replacement
.A symbol is a string of alphanumeric, -
or _
characters. A replacement can be any string. They are replaced in the following places:
color: my_symbol;
or box-shadow: 0 0 blur spread shadow-color
@media small {}
or @media screen and not-large {}
Extracts and remove (if removeRules is equal true) from PostCSS tree :import
, @icss-import
, :export
and @icss-export
statements.
1import postcss from "postcss"; 2import { extractICSS } from "icss-utils"; 3 4const css = postcss.parse(` 5 :import(colors) { 6 a: b; 7 } 8 :export { 9 c: d; 10 } 11`); 12 13extractICSS(css); 14/* 15 { 16 icssImports: { 17 colors: { 18 a: 'b' 19 } 20 }, 21 icssExports: { 22 c: 'd' 23 } 24 } 25*/
By default both the pseudo and at-rule form of the import and export statements
will be removed. Pass the mode
option to limit to only one type.
Converts icss imports and exports definitions to postcss ast
1createICSSRules(
2 {
3 colors: {
4 a: "b",
5 },
6 },
7 {
8 c: "d",
9 },
10 // Need pass `rule` and `decl` from postcss
11 // Please look at `Step 4` https://evilmartians.com/chronicles/postcss-8-plugin-migration
12 postcss
13);
By default it will create pseudo selector rules (:import
and :export
). Pass
at-rule
for mode
to instead generate @icss-import
and @icss-export
, which
may be more resilient to post processing by other tools.
ISC
Glen Maddern, Bogdan Chadkin and Evilebottnawi 2015-present.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/24 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
34 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More