Gathering detailed insights and metrics for css-calc-transform
Gathering detailed insights and metrics for css-calc-transform
npm install css-calc-transform
Typescript
Module System
78.4
Supply Chain
99.4
Quality
76.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
68,549
Last Day
805
Last Week
2,405
Last Month
7,232
Last Year
56,930
13 Stars
266 Commits
1 Forks
3 Watching
8 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.1.0
Package Id
css-calc-transform@1.1.0
Unpacked Size
329.49 kB
Size
114.66 kB
File Count
22
Publised On
25 Feb 2024
Cumulative downloads
Total Downloads
Last day
659.4%
805
Compared to previous day
Last week
36.5%
2,405
Compared to previous week
Last month
-9.5%
7,232
Compared to previous month
Last year
545.5%
56,930
Compared to previous year
Tiny Javascript library to transform CSS properties with CSS calc() function values to pixels based on window and element dimensions.
1yarn add --save css-calc-transform
or
1npm install --save css-calc-transform
1import { transform } from "css-calc-transform"; 2 3transform({ 4 prop: "width", 5 value: "calc(10px + (100px / 3.5))" 6}); 7 8↓ ↓ ↓ ↓ ↓ ↓ 9 1038.57142857142857
1import { transform } from "css-calc-transform"; 2 3const parentElementDimensions = { 4 width: 480, 5 height: 100 6}; 7 8transform({ 9 prop: "width", 10 value: "calc(100% - 10px)", 11 parent: parentElementDimensions 12}); 13 14↓ ↓ ↓ ↓ ↓ ↓ 15 16470
1import { transform } from "css-calc-transform"; 2 3const windowDimensions = { 4 width: 480, 5 height: 640 6}; 7 8transform({ 9 prop: "height", 10 value: "calc(50vh + 10px)", 11 win: windowDimensions 12}); 13 14↓ ↓ ↓ ↓ ↓ ↓ 15 16330
1import { transform } from "css-calc-transform"; 2 3transform({ 4 prop: "fontSize", 5 value: "calc(2rem + 1px)", 6}); 7 8↓ ↓ ↓ ↓ ↓ ↓ 9 1033
When em units are used on font-size, the size is relative to the font-size of the parent.
When used on other properties, it’s relative to the font-size of the element itself.
https://www.digitalocean.com/community/tutorials/css-rem-vs-em-units
1import { transform } from "css-calc-transform"; 2 3transform({ 4 prop: "fontSize", 5 value: "calc(2em + 1px)", 6 parent: { 7 font: { 8 size: 16 9 } 10 } 11}); 12 13↓ ↓ ↓ ↓ ↓ ↓ 14 1533
1import { transform } from "css-calc-transform"; 2 3transform({ 4 prop: "height", 5 value: "calc(10px + 2em)", 6 font: { 7 size: 16 8 } 9}); 10 11↓ ↓ ↓ ↓ ↓ ↓ 12 1342
1import { transform } from "css-calc-transform"; 2 3transform({ 4 prop: "height", 5 value: "calc(min(2px, 3px) + clamp(100px, 150px, 200px) + max(1px, 2px))", 6}); 7 8↓ ↓ ↓ ↓ ↓ ↓ 9 10154
For more examples, please have a look at the tests.
eval()
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
6 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
Score
Last Scanned on 2025-01-27
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