Skip to content

Commit c33ad22

Browse files
author
Gary Tokman
committed
fix: updates
1 parent 8d80c6d commit c33ad22

File tree

2 files changed

+53
-37
lines changed

2 files changed

+53
-37
lines changed

index.js

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,60 @@
1-
var plugin = require('tailwindcss/plugin');
2-
module.exports = plugin(function (_a) {
3-
var addUtilities = _a.addUtilities, theme = _a.theme;
4-
var options = theme('cornerSmoothing') || {};
5-
var sizes = options.sizes || {
6-
sm: '25px',
7-
md: '60px',
8-
lg: '75px',
1+
const plugin = require('tailwindcss/plugin');
2+
3+
module.exports = plugin(
4+
function (_a) {
5+
const { addUtilities } = _a;
6+
const { theme } = _a;
7+
const options = theme('cornerSmoothing') || {};
8+
const sizes = options.sizes || {
9+
sm: '25px',
10+
md: '60px',
11+
lg: '75px',
912
};
10-
var utilities = {};
13+
const utilities = {};
1114
Object.entries(sizes).forEach(function (_a) {
12-
var key = _a[0], size = _a[1];
13-
utilities[".smooth-corners-".concat(key)] = {
14-
'@supports (mask-border-width: 50px)': {
15-
'mask-border': "url(\"".concat(options.maskPath || './assets/masks/[email protected]', "\") 49% fill / ").concat(size),
16-
'@media (min-resolution: 2x)': {
17-
'mask-border': "url(\"".concat(options.maskPath2x || './assets/masks/[email protected]', "\") 49% fill / ").concat(size),
18-
},
19-
'@media (min-resolution: 3x)': {
20-
'mask-border': "url(\"".concat(options.maskPath3x || './assets/masks/[email protected]', "\") 49% fill / ").concat(size),
21-
},
22-
},
23-
};
15+
const key = _a[0];
16+
const size = _a[1];
17+
utilities['.smooth-corners-'.concat(key)] = {
18+
'@supports (mask-border-width: 50px)': {
19+
'mask-border': 'url("'
20+
.concat(
21+
options.maskPath || './assets/masks/[email protected]',
22+
'") 49% fill / '
23+
)
24+
.concat(size),
25+
'@media (min-resolution: 2x)': {
26+
'mask-border': 'url("'
27+
.concat(
28+
options.maskPath2x || './assets/masks/[email protected]',
29+
'") 49% fill / '
30+
)
31+
.concat(size),
32+
},
33+
'@media (min-resolution: 3x)': {
34+
'mask-border': 'url("'
35+
.concat(
36+
options.maskPath3x || './assets/masks/[email protected]',
37+
'") 49% fill / '
38+
)
39+
.concat(size),
40+
},
41+
},
42+
};
2443
});
2544
addUtilities(utilities);
26-
}, {
45+
},
46+
{
2747
theme: {
28-
cornerSmoothing: {
29-
maskPath: './assets/masks/[email protected]',
30-
maskPath2x: './assets/masks/[email protected]',
31-
maskPath3x: './assets/masks/[email protected]',
32-
sizes: {
33-
sm: '25px',
34-
md: '60px',
35-
lg: '75px',
36-
},
48+
cornerSmoothing: {
49+
maskPath: './assets/masks/[email protected]',
50+
maskPath2x: './assets/masks/[email protected]',
51+
maskPath3x: './assets/masks/[email protected]',
52+
sizes: {
53+
sm: '25px',
54+
md: '60px',
55+
lg: '75px',
3756
},
57+
},
3858
},
39-
});
59+
}
60+
);

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
"release": "npx tsc index.ts && standard-version",
1919
"postrelease": "git push --follow-tags origin main && npm publish"
2020
},
21-
"husky": {
22-
"hooks": {
23-
"pre-commit": "npm run lint:fix && npm run format && npm run test"
24-
}
25-
},
2621
"repository": {
2722
"type": "git",
2823
"url": "git+https://github.com/gtokman/corner-smoothing.git"

0 commit comments

Comments
 (0)