Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-hexrgba

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-hexrgba - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

33

index.js

@@ -38,19 +38,20 @@ 'use strict';

// Get the raw hex values and replace them
let output = input.replace(/rgba\(#(.*?),/g, (match, hex) => {
let rgb = hexRgb(hex),
matchHex = new RegExp('#' + hex);
if (input.includes('rgba(#')) {
// Get the raw hex values and replace them
let output = input.replace(/rgba\(#(.*?),/g, (match, hex) => {
let rgb = hexRgb(hex),
matchHex = new RegExp('#' + hex);
// If conversion fails, emit a warning
if (!rgb) {
result.warn('not a valid hex', { node: decl });
return match;
}
rgb = rgb.toString();
// If conversion fails, emit a warning
if (!rgb) {
result.warn('not a valid hex', { node: decl });
return match;
}
rgb = rgb.toString();
return match.replace(matchHex, rgb);
});
decl.value = output;
return match.replace(matchHex, rgb);
});
decl.value = output;
}
}

@@ -57,0 +58,0 @@

{
"name": "postcss-hexrgba",
"version": "1.0.2",
"version": "2.0.0",
"description": "PostCSS plugin that adds shorthand hex methods to rgba() values",

@@ -13,6 +13,3 @@ "keywords": [

"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/seaneking/postcss-hexrgba.git"
},
"repository": "seaneking/postcss-hexrgba",
"author": "Sean King <sean@simpla.io>",

@@ -26,13 +23,9 @@ "maintainers": [

],
"bugs": {
"url": "https://github.com/seaneking/postcss-hexrgba/issues"
},
"homepage": "https://github.com/seaneking/postcss-hexrgba",
"dependencies": {
"postcss": "^6.0.7"
"postcss": "^7.0.14"
},
"devDependencies": {
"chai": "^4.0.2",
"eslint": "^4.1.1",
"mocha": "^3.4.2"
"chai": "^4.2.0",
"eslint": "^5.16.0",
"mocha": "^6.1.1"
},

@@ -39,0 +32,0 @@ "scripts": {

# PostCSS HexRGBA
[![NPM version][npm-badge]][npm-url] [![Downloads][downloads-badge]][npm-url] [![Build Status][travis-badge]][travis-url]
[PostCSS][PostCSS] plugin that adds shorthand hex methods to rbga() values.
[PostCSS][PostCSS] plugin that adds shorthand hex methods to rgba() values.

@@ -6,0 +6,0 @@ _Part of [Rucksack - CSS Superpowers](http://simplaio.github.io/rucksack)_

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc