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
@types/icss-utils
TypeScript definitions for icss-utils
icss-replace-symbols
Replacing symbols during the linking phase of ICSS
postcss-icss-selectors
PostCSS plugin for css modules to local-scope classes and ids
postcss-icss-keyframes
PostCSS plugin for css-modules to local-scope keyframes
Search & replace tokens during the linking stage of ICSS loading
npm install icss-utils
96.1
Supply Chain
98.2
Quality
80.7
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
23 Stars
67 Commits
15 Forks
6 Watching
39 Branches
15 Contributors
Updated on 13 Nov 2023
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-6.6%
3,184,239
Compared to previous day
Last week
1.1%
17,920,599
Compared to previous week
Last month
8.1%
76,056,160
Compared to previous month
Last year
-9.1%
859,823,640
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
31 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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