Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Sass implementation of the [Accessible Perceptual Contrast Algorithm (APCA)](https://git.apcacontrast.com/) for the WCAG 3.0 specification.
Sass implementation of the Accessible Perceptual Contrast Algorithm (APCA) for the WCAG 3.0 specification.
These scss functions are compatible with sass (dart sass) v1.33 and up.
npm install sass-apca
APCA reports lightness contrast as an Lc value from Lc 0 to Lc 106 for dark text on a light background, and Lc 0 to Lc -108 for light text on a dark background (dark mode). The minus sign merely indicates negative contrast, which means light text on a dark background. 1
Parameter | Type | Description |
---|---|---|
$text-color | Sass Color | Color of the text |
$background-color | Sass Color | Color of the background |
@use 'sass-apca/apca';
$contrast-black-on-white: apca.contrast(black, white); // 106.0406668287
$contrast-white-on-black: apca.contrast(white, black); // -107.8847261151
Checks a light and a dark text color against a given background and returns the text color with the best contrast.
Parameter | Type | Default | Description |
---|---|---|---|
$backgroundColor | Sass color | The background color to check against | |
$lightColor | Sass color | white | [optional] A light text color |
$darkColor | Sass color | black | [optional] A dark text color |
@use 'sass-apca/apca';
body {
background-color: #ccc;
// either white or black text color
color: apca.recommend-text-color(#ccc); // white
// with custom light and dark text colors
color: apca.recommend-text-color(#ccc, #eee, #111); // #111
}
These general levels are appropriate for use by themselves, without the need to reference a lookup table. APCA reports contrast as an Lc value (lightness contrast) from Lc 0 to Lc 105+. For accessibility, consider Lc 15 the point of invisibility for many users, and Lc 90 is preferred for body text. 2
Code published in this repository licensed under the MIT license.
APCA contrast calculator (https://www.myndex.com/APCA/) ↩
Why APCA (https://git.apcacontrast.com/documentation/WhyAPCA#use-case-ranges) ↩
FAQs
Sass implementation of the [Accessible Perceptual Contrast Algorithm (APCA)](https://git.apcacontrast.com/) for the WCAG 3.0 specification.
The npm package sass-apca receives a total of 2 weekly downloads. As such, sass-apca popularity was classified as not popular.
We found that sass-apca demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.