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.
simple-colors-scss
Advanced tools
Simple-colors-scss is a map based color manager for SCSS.
It aims towards simple setup, utilization and extendibility.
Install the package using NPM:
npm install simple-colors-scss --save
Create a empty theme file from the project directory:
npm run create --prefix ./node_modules/simple-colors-scss
Import the package and newly created _colors.scss
into your stylesheet (before other logic):
1. @import 'your_project/node_modules/simple-colors-scss/core';
2. @import 'your_project/colors';
A color scheme is a map of color codes and bindings inside _colors.scss
.
Add unique colors to the $colors
variable:
(These use name-that-color)
$colors: {
// Named colors (HEX):
'white': #FFF,
'deep-orange': #BDBDBD,
'alizarin-crimson': #E32636
// but we can use other color systems:
'purple-rgb': rgb(255,0,128),
'white-rgba-33' rgba(255,255,255, .33),
'blue-hsl': hsl(240, 100%, 50%),
// or metavalues
'transparent': transparent
}
Next add custom bindings, shorthands and variations to $bindings
using the color() function:
$binding: {
// use shorthands
'orange': color('deep-orange'),
'pink': color('alizarin-crimson'),
// or variations
'orange-light': lighten(color('deep-orange'), 30%),
'orange-dark': darken(color('deep-orange'), 30%),
// or theming
'primary': color('alizarin-crimson'),
'primary-text': color('white'),
// or complex colors
'border-y': color('orange-dark') color('none'),
'gradient': linear-gradient(to left, color('deep-orange'), color('alizarin-crimson'))
}
Next to $bindings
the color()
function is used in your regular SCSS to fetch colors:
background-image: color("blue-hsl");
Check out simple-colors-scss-helpers for mixins
@import "your/project/node_modules/simple-colors-scss";
@include bg('blue-hsl'); // will produce the same
If the value is either indefined or unknow it will fail gracefully.
// @debug "Unknown color: #{$key}
found, value could not be set";
## Use it:
Now you can do things like:
color: color('white'); background-color(color('orange-dark')); border: 1px solid color('border-y');
FAQs
Simple color management for SCSS
The npm package simple-colors-scss receives a total of 0 weekly downloads. As such, simple-colors-scss popularity was classified as not popular.
We found that simple-colors-scss 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.