tailwindcss-elevation
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -10,2 +10,11 @@ # Changelog | ||
### Changed | ||
- Update tailwindcss version | ||
- Move to tailwindcss/plugin | ||
### Security | ||
- Update dependencies to fix security vulnerabilities | ||
## [1.0.1] - 2020-12-06 | ||
@@ -12,0 +21,0 @@ |
20
index.js
@@ -1,13 +0,15 @@ | ||
const validateConfig = require("./src/validate-config"); | ||
const plugin = require("tailwindcss/plugin"); | ||
const validateOptions = require("./src/validate-options"); | ||
const utilities = require("./src/utilities"); | ||
module.exports = function(variants, config) { | ||
const err = validateConfig(config); | ||
if (err) { | ||
throw err; | ||
} | ||
module.exports = plugin.withOptions(function (options = {}) { | ||
return function ({ addUtilities }) { | ||
const err = validateOptions(options); | ||
if (err) { | ||
throw err; | ||
} | ||
return function({ addUtilities }) { | ||
addUtilities(utilities(config), variants); | ||
addUtilities(utilities(options)); | ||
}; | ||
}; | ||
}); |
{ | ||
"name": "tailwindcss-elevation", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Tailwind CSS plugin for Material Components elevation classes.", | ||
@@ -22,3 +22,3 @@ "author": "Joonas Kykkänen <jonaskay@iki.fi>", | ||
"autoprefixer": "^10.0.4", | ||
"chai": "^4.2.0", | ||
"chai": "^4.3.7", | ||
"chai-fs": "^2.0.0", | ||
@@ -28,3 +28,3 @@ "eslint": "^7.15.0", | ||
"eslint-config-standard": "^14.1.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-node": "^11.0.0", | ||
@@ -38,4 +38,4 @@ "eslint-plugin-prettier": "^3.1.1", | ||
"nyc": "^15.0.0", | ||
"postcss": "^8.1.14", | ||
"postcss-cli": "^8.3.0", | ||
"postcss": "^8.2.13", | ||
"postcss-cli": "^10.1.0", | ||
"prettier": "2.2.1" | ||
@@ -47,3 +47,3 @@ }, | ||
"peerDependencies": { | ||
"tailwindcss": "^2.0.1" | ||
"tailwindcss": "^3.0.1" | ||
}, | ||
@@ -50,0 +50,0 @@ "husky": { |
@@ -17,3 +17,3 @@ # tailwindcss-elevation | ||
plugins: [ | ||
require('tailwindcss-elevation')(['responsive']), | ||
require('tailwindcss-elevation'), | ||
] | ||
@@ -23,6 +23,2 @@ } | ||
If you don't need the responsive versions, you can pass in an empty array. | ||
You can also include other supported variants. For the full list of available variants, see https://tailwindcss.com/docs/configuring-variants. | ||
To learn more about configuring your Tailwind CSS installation, see https://tailwindcss.com/docs/configuration. | ||
@@ -32,3 +28,3 @@ | ||
To change the default configurations, you can include a config object: | ||
To change the default configurations, you can include an options object: | ||
@@ -39,3 +35,2 @@ ```javascript | ||
require('tailwindcss-elevation')( | ||
[], | ||
{ | ||
@@ -50,3 +45,3 @@ color: '77,192,181', | ||
Config object accepts the following properties: | ||
Options accept the following properties: | ||
@@ -53,0 +48,0 @@ * `color` changes the default box-shadow base color and accepts an RGB (e.g. `'77,192,181'`) or HEX triplet (e.g. `'#4dc0b5'`) as its value. When using a CSS custom property (variable) as the value, you have to use an RGB triplet. |
@@ -28,3 +28,3 @@ module.exports = { | ||
23: "0px 11px 14px -7px", | ||
24: "0px 11px 15px -7px" | ||
24: "0px 11px 15px -7px", | ||
}, | ||
@@ -56,3 +56,3 @@ penumbra: { | ||
23: "0px 23px 36px 3px", | ||
24: "0px 24px 38px 3px" | ||
24: "0px 24px 38px 3px", | ||
}, | ||
@@ -84,4 +84,4 @@ ambient: { | ||
23: "0px 9px 44px 8px", | ||
24: "0px 9px 46px 8px" | ||
} | ||
24: "0px 9px 46px 8px", | ||
}, | ||
}, | ||
@@ -92,4 +92,4 @@ | ||
penumbra: ".14", | ||
ambient: ".12" | ||
} | ||
ambient: ".12", | ||
}, | ||
}; |
module.exports = { | ||
customProperty: "var([^)]+)", | ||
hex: "#[A-Fa-f0-9]+", | ||
rgb: "\\s*\\d+\\s*\\,\\s*\\d+\\s*\\,\\s*\\d+\\s*" | ||
rgb: "\\s*\\d+\\s*\\,\\s*\\d+\\s*\\,\\s*\\d+\\s*", | ||
}; |
186
9843
59