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

postcss-elm-tailwind

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-elm-tailwind - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

16

helpers.js

@@ -57,2 +57,4 @@ function elmHeader(elm_fns) {

cls = cls.replace(/\::(placeholder)$/, "");
//
cls = cls.replace(/\\\//g, "/");
// make \/ safe for elm

@@ -70,12 +72,12 @@ cls = cls.replace(/\\([/])/g, "\\\\$1");

function toElmName(cls, prefix) {
if (!prefix) {
prefix = "";
}
re_neg_with_prefix = new RegExp(`(${prefix})-([p|m])`);
var elm = cls;
// handle negative with prefix
elm = elm.replace(re_neg_with_prefix, "$1neg_$2");
if (prefix) {
re_neg_with_prefix = new RegExp(`(${prefix})-([p|m])`);
elm = elm.replace(re_neg_with_prefix, "$1neg_$2");
}
// handle negative at start of string
elm = elm.replace(/^-([p|m])/, "_neg_$1");
// handle negative with variant
elm = elm.replace(/:-([p|m])/, "_neg_$1");
// replace dashes now we have sorted the negative stuff

@@ -86,3 +88,3 @@ elm = elm.replace(/-/g, "_");

// handle fractions
elm = elm.replace(/\\\\\//g, "over");
elm = elm.replace(/\//g, "over");
// clean up

@@ -89,0 +91,0 @@ elm = elm.replace(/\\__/g, "_");

{
"name": "postcss-elm-tailwind",
"main": "./index.js",
"version": "0.2.1",
"version": "0.2.2",
"description": "PostCSS plugin Tailwind classes for Elm",

@@ -6,0 +6,0 @@ "keywords": [

@@ -22,6 +22,9 @@ const h = require("../helpers");

assert.equal(
h.fixClass("hover:tw-bg-blue-500:hover"),
h.fixClass(".hover:tw-bg-blue-500:hover"),
"hover:tw-bg-blue-500"
);
});
it("ratio", function() {
assert.equal(h.fixClass(".w-1\\/2"), "w-1/2");
});
});

@@ -69,2 +72,11 @@

});
it("cursor-pointer", function() {
assert.equal(
h.toElmName(h.fixClass(".cursor-pointer"), ""),
"cursor_pointer"
);
});
it("font-medium", function() {
assert.equal(h.toElmName(h.fixClass(".font-medium"), ""), "font_medium");
});
});
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