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

postcss-color-rebeccapurple

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-color-rebeccapurple - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 1.2.0 - 2015-07-01
- Upgrade to PostCSS 4.1.x
# 1.1.0 - 2014-11-25

@@ -2,0 +6,0 @@

31

index.js
/**
* Module dependencies.
*/
var color = require("color")
var helpers = require("postcss-message-helpers")
var postcss = require("postcss")
var color = require("color")("rebeccapurple").rgbString()

@@ -10,25 +10,12 @@ /**

*/
module.exports = function plugin() {
module.exports = postcss.plugin("postcss-color-rebeccapurple", function() {
return function(style) {
style.eachDecl(function transformDecl(decl) {
if (!decl.value || decl.value.indexOf("rebeccapurple") === -1) {
return
style.eachDecl(function(decl) {
var value = decl.value;
if (value && value.indexOf("rebeccapurple") !== -1) {
decl.value = value.replace(/(rebeccapurple)\b/gi, color)
}
decl.value = helpers.try(function transformRebeccapurpleValue() {
return transformRebeccapurple(decl.value)
}, decl.source)
})
}
}
/**
* Transform rebeccapurple color to rgb()
*
* @param {String} string declaration value
* @return {String} converted declaration value to rgba()
*/
function transformRebeccapurple(string) {
return string.replace(/(rebeccapurple)\b/gi, color("rebeccapurple").rgbString())
}
})
{
"name": "postcss-color-rebeccapurple",
"version": "1.1.0",
"version": "1.2.0",
"description": "PostCSS plugin to transform W3C CSS rebeccapurple color to more compatible CSS (rgb())",

@@ -8,3 +8,3 @@ "keywords": [

"postcss",
"postcss-plugins",
"postcss-plugin",
"color",

@@ -27,4 +27,4 @@ "colour",

"dependencies": {
"color": "^0.7.1",
"postcss-message-helpers": "^1.1.0"
"color": "^0.9.0",
"postcss": "^4.1.13"
},

@@ -34,4 +34,3 @@ "devDependencies": {

"jshint": "^2.5.6",
"postcss": "^3.0.0",
"tape": "^3.0.0"
"tape": "^4.0.0"
},

@@ -38,0 +37,0 @@ "scripts": {

# postcss-color-rebeccapurple [![Build Status](https://travis-ci.org/postcss/postcss-color-rebeccapurple.png)](https://travis-ci.org/postcss/postcss-color-rebeccapurple)
> [PostCSS](https://github.com/postcss/postcss) plugin to transform [W3C CSS `rebeccapurple` color](http://dev.w3.org/csswg/css-color/#valuedef-color-rebeccapurple) to more compatible CSS (rgb()).
> [PostCSS](https://github.com/postcss/postcss) plugin to transform [W3C CSS `rebeccapurple` color](http://dev.w3.org/csswg/css-color/#valdef-color-rebeccapurple) to more compatible CSS (rgb()).
## Why this plugin ?
If you did some CSS, I'm sure you know who [Eric Meyer](https://en.wikipedia.org/wiki/Eric_A._Meyer) is, & what he did for this language.
If you did some CSS, I'm sure you know who [Eric Meyer](https://en.wikipedia.org/wiki/Eric_A._Meyer) is, & what he did for this language.
In memory of [Eric Meyer’s daughter](http://meyerweb.com/eric/thoughts/2014/06/09/in-memoriam-2/), [W3C added new color rebeccapurple to CSS 4 Color Module](http://lists.w3.org/Archives/Public/www-style/2014Jun/0312.html).

@@ -9,0 +9,0 @@

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