2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-29 05:29:09 +00:00

chore: cleaner css for icon, update utils and tailwind plugin, update dependencies

This commit is contained in:
Vjacheslav Trushkin 2023-06-06 19:10:54 +03:00
parent 00d825d6af
commit 7bec9456c8
17 changed files with 2973 additions and 1417 deletions

View File

@ -48,20 +48,20 @@
"@iconify/types": "workspace:^"
},
"devDependencies": {
"@babel/preset-env": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@babel/preset-env": "^7.22.4",
"@babel/preset-react": "^7.22.3",
"@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.34.4",
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/react": "^18.0.31",
"@microsoft/api-extractor": "^7.35.1",
"@rollup/plugin-node-resolve": "^15.1.0",
"@types/react": "^18.2.8",
"babel-jest": "^29.5.0",
"jest": "^29.5.0",
"react": "^18.2.0",
"react-test-renderer": "^18.2.0",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"typescript": "^5.0.3"
"rollup": "^3.23.1",
"typescript": "^5.1.3"
},
"peerDependencies": {
"react": ">=16"

View File

@ -31,20 +31,20 @@
"devDependencies": {
"@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.34.4",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^11.0.0",
"@sveltejs/vite-plugin-svelte": "^2.0.4",
"@microsoft/api-extractor": "^7.35.1",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-typescript": "^11.1.1",
"@sveltejs/vite-plugin-svelte": "^2.4.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/svelte": "^3.2.2",
"@tsconfig/svelte": "^4.0.1",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@types/jest": "^29.5.2",
"@types/node": "^18.16.16",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"rollup-plugin-svelte": "^7.1.4",
"rollup": "^3.23.1",
"rollup-plugin-svelte": "^7.1.5",
"svelte": "3.58.0",
"svelte-preprocess": "^5.0.3",
"svelte-preprocess": "^5.0.4",
"vitest": "^0.29.8"
},
"peerDependencies": {

View File

@ -74,21 +74,21 @@
"devDependencies": {
"@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.34.4",
"@rollup/plugin-node-resolve": "^15.0.1",
"@microsoft/api-extractor": "^7.35.1",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-terser": "^0.4.0",
"@types/jest": "^29.5.0",
"@rollup/plugin-terser": "^0.4.3",
"@types/jest": "^29.5.2",
"@types/jsdom": "^21.1.1",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"cross-env": "^7.0.3",
"eslint": "^8.37.0",
"eslint": "^8.42.0",
"jest": "^29.5.0",
"jsdom": "^21.1.1",
"jsdom": "^21.1.2",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"ts-jest": "^29.0.5",
"typescript": "^5.0.3"
"rollup": "^3.23.1",
"ts-jest": "^29.1.0",
"typescript": "^5.1.3"
}
}

View File

@ -45,19 +45,19 @@
"@iconify/types": "workspace:^"
},
"devDependencies": {
"@babel/preset-env": "^7.21.4",
"@babel/preset-env": "^7.22.4",
"@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.34.4",
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/jest": "^29.5.0",
"@vitejs/plugin-vue": "^4.1.0",
"@microsoft/api-extractor": "^7.35.1",
"@rollup/plugin-node-resolve": "^15.1.0",
"@types/jest": "^29.5.2",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/test-utils": "^2.3.2",
"jsdom": "^21.1.1",
"rollup": "^3.20.2",
"typescript": "^5.0.3",
"jsdom": "^21.1.2",
"rollup": "^3.23.1",
"typescript": "^5.1.3",
"vitest": "^0.29.8",
"vue": "^3.2.47"
"vue": "^3.3.4"
},
"peerDependencies": {
"vue": ">=3"

View File

@ -45,19 +45,19 @@
"@iconify/types": "workspace:^"
},
"devDependencies": {
"@babel/preset-env": "^7.21.4",
"@babel/preset-env": "^7.22.4",
"@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.34.4",
"@microsoft/api-extractor": "^7.35.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/jest": "^29.5.0",
"@vue/test-utils": "^1.3.4",
"@vue/vue2-jest": "^29.2.3",
"@types/jest": "^29.5.2",
"@vue/test-utils": "^1.3.6",
"@vue/vue2-jest": "^29.2.4",
"babel-jest": "^29.5.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"rollup": "^2.79.1",
"typescript": "^5.0.3",
"typescript": "^5.1.3",
"vue": "^2.7.14",
"vue-template-compiler": "^2.7.14"
},

View File

@ -56,21 +56,21 @@
"devDependencies": {
"@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.34.4",
"@rollup/plugin-node-resolve": "^15.0.1",
"@microsoft/api-extractor": "^7.35.1",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-terser": "^0.4.0",
"@types/jest": "^29.5.0",
"@rollup/plugin-terser": "^0.4.3",
"@types/jest": "^29.5.2",
"@types/jsdom": "^21.1.1",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"cross-env": "^7.0.3",
"eslint": "^8.37.0",
"eslint": "^8.42.0",
"jest": "^29.5.0",
"jsdom": "^21.1.1",
"jsdom": "^21.1.2",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"ts-jest": "^29.0.5",
"typescript": "^5.0.3"
"rollup": "^3.23.1",
"ts-jest": "^29.1.0",
"typescript": "^5.1.3"
}
}

View File

@ -38,7 +38,7 @@
"iconify-icon": "workspace:^"
},
"devDependencies": {
"@types/react": "^18.0.31",
"@types/react": "^18.2.8",
"@types/react-test-renderer": "^18.0.0",
"@vitejs/plugin-react": "^3.1.0",
"jest": "^29.5.0",
@ -46,7 +46,7 @@
"react-test-renderer": "^18.2.0",
"rimraf": "^4.4.1",
"tsup": "^6.7.0",
"typescript": "^5.0.3",
"typescript": "^5.1.3",
"vitest": "^0.29.8"
},
"peerDependencies": {

View File

@ -25,8 +25,8 @@
},
"devDependencies": {
"rimraf": "^4.4.1",
"solid-js": "^1.7.1",
"typescript": "^5.0.3"
"solid-js": "^1.7.6",
"typescript": "^5.1.3"
},
"peerDependencies": {
"solid-js": ">=1"

View File

@ -28,12 +28,12 @@
"directory": "packages/api-redundancy"
},
"devDependencies": {
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"@types/jest": "^29.5.2",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"cross-env": "^7.0.3",
"eslint": "^8.37.0",
"eslint": "^8.42.0",
"tsup": "^6.7.0",
"vitest": "^0.29.8"
}

View File

@ -133,16 +133,16 @@
"@iconify/utils": "workspace:^"
},
"devDependencies": {
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"cross-fetch": "^3.1.5",
"eslint": "^8.37.0",
"@types/jest": "^29.5.2",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"cross-fetch": "^3.1.6",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"rimraf": "^4.4.1",
"typescript": "^5.0.3",
"unbuild": "^1.2.0",
"typescript": "^5.1.3",
"unbuild": "^1.2.1",
"vitest": "^0.29.8"
}
}

View File

@ -3,7 +3,7 @@
"type": "module",
"description": "Common functions for working with Iconify icon sets used by various packages.",
"author": "Vjacheslav Trushkin",
"version": "2.1.5",
"version": "2.1.6",
"license": "MIT",
"bugs": "https://github.com/iconify/iconify/issues",
"homepage": "https://iconify.design/docs/libraries/utils/",
@ -374,24 +374,24 @@
],
"dependencies": {
"@antfu/install-pkg": "^0.1.1",
"@antfu/utils": "^0.7.2",
"@antfu/utils": "^0.7.4",
"@iconify/types": "workspace:^",
"debug": "^4.3.4",
"kolorist": "^1.7.0",
"kolorist": "^1.8.0",
"local-pkg": "^0.4.3"
},
"devDependencies": {
"@iconify-json/flat-color-icons": "^1.1.6",
"@types/debug": "^4.1.7",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"eslint": "^8.37.0",
"@types/debug": "^4.1.8",
"@types/jest": "^29.5.2",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"rimraf": "^4.4.1",
"typescript": "^5.0.3",
"unbuild": "^1.2.0",
"typescript": "^5.1.3",
"unbuild": "^1.2.1",
"vitest": "^0.29.8"
}
}

View File

@ -23,19 +23,21 @@ export function getCommonCSSRules(
switch (options.mode) {
case 'background':
result['background'] = 'no-repeat center / 100%';
if (varName) {
result['background-image'] = 'var(--' + varName + ')';
}
result['background-repeat'] = 'no-repeat';
result['background-size'] = '100% 100%';
break;
case 'mask':
result['background-color'] = 'currentColor';
result['mask'] = result['-webkit-mask'] = 'no-repeat center / 100%';
if (varName) {
result['mask-image'] = result['-webkit-mask-image'] =
'var(--' + varName + ')';
}
result['mask-repeat'] = result['-webkit-mask-repeat'] = 'no-repeat';
result['mask-size'] = result['-webkit-mask-size'] = '100% 100%';
break;
}

View File

@ -21,7 +21,8 @@ describe('Testing CSS for icon', () => {
display: inline-block;
width: 1.5em;
height: 1em;
background: no-repeat center / 100%;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: ${expectedURL};
}
`);
@ -50,7 +51,8 @@ describe('Testing CSS for icon', () => {
width: 1em;
height: 1em;
content: '';
background: no-repeat center / 100%;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: ${expectedURL};
}
`);
@ -76,10 +78,12 @@ describe('Testing CSS for icon', () => {
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask: no-repeat center / 100%;
mask: no-repeat center / 100%;
-webkit-mask-image: var(--svg);
mask-image: var(--svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
--svg: ${expectedURL};
}
`);
@ -105,7 +109,8 @@ describe('Testing CSS for icon', () => {
display: inline-block;
width: 1em;
height: 1em;
background: no-repeat center / 100%;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: ${expectedURL};
}
`);
@ -130,8 +135,10 @@ describe('Testing CSS for icon', () => {
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask: no-repeat center / 100%;
mask: no-repeat center / 100%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
-webkit-mask-image: ${expectedURL};
mask-image: ${expectedURL};
}

View File

@ -41,10 +41,12 @@ describe('Testing CSS for multiple icons', () => {
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask: no-repeat center / 100%;
mask: no-repeat center / 100%;
-webkit-mask-image: var(--svg);
mask-image: var(--svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
}
.icon--test-prefix--activity {
@ -70,7 +72,8 @@ describe('Testing CSS for multiple icons', () => {
display: inline-block;
width: 1em;
height: 1em;
background: no-repeat center / 100%;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.icon--test-prefix--123 {
@ -88,7 +91,8 @@ describe('Testing CSS for multiple icons', () => {
display: inline-block;
width: 1em;
height: 1em;
background: no-repeat center / 100%;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.icon--test-prefix--empty {
@ -149,10 +153,12 @@ describe('Testing CSS for multiple icons', () => {
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask: no-repeat center / 100%;
mask: no-repeat center / 100%;
-webkit-mask-image: var(--svg);
mask-image: var(--svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
}
.icon--bi--activity {
@ -219,8 +225,10 @@ describe('Testing CSS for multiple icons', () => {
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask: no-repeat center / 100%;
mask: no-repeat center / 100%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
}
.icon--bi.icon--bi--activity {
@ -291,10 +299,12 @@ describe('Testing CSS for multiple icons', () => {
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask: no-repeat center / 100%;
mask: no-repeat center / 100%;
-webkit-mask-image: var(--svg);
mask-image: var(--svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
}
.test--activity {
@ -363,10 +373,12 @@ describe('Testing CSS for multiple icons', () => {
width: 1.5em;
height: 1em;
background-color: currentColor;
-webkit-mask: no-repeat center / 100%;
mask: no-repeat center / 100%;
-webkit-mask-image: var(--svg);
mask-image: var(--svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
--svg: ${expectedURL('activity')};
}
`);

View File

@ -2,7 +2,7 @@
"name": "@iconify/tailwind",
"description": "Iconify plugin for Tailwind CSS",
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT",
"main": "./dist/plugin.js",
"types": "./dist/plugin.d.ts",
@ -28,22 +28,22 @@
"@iconify/types": "workspace:^"
},
"devDependencies": {
"@iconify-json/line-md": "^1.1.23",
"@iconify-json/line-md": "^1.1.24",
"@iconify-json/mdi-light": "^1.1.6",
"@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.34.4",
"@rollup/plugin-node-resolve": "^15.0.1",
"@microsoft/api-extractor": "^7.35.1",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-replace": "^5.0.2",
"@types/jest": "^29.5.0",
"@types/jest": "^29.5.2",
"@types/jsdom": "^21.1.1",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"eslint": "^8.37.0",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"eslint": "^8.42.0",
"jest": "^29.5.0",
"rimraf": "^4.4.1",
"rollup": "^3.20.2",
"tailwindcss": "^3.3.1",
"ts-jest": "^29.0.5",
"typescript": "^5.0.3"
"rollup": "^3.23.1",
"tailwindcss": "^3.3.2",
"ts-jest": "^29.1.0",
"typescript": "^5.1.3"
}
}

View File

@ -9,10 +9,12 @@ describe('Testing dynamic CSS rules', () => {
'width': '1em',
'height': '1em',
'background-color': 'currentColor',
'-webkit-mask': 'no-repeat center / 100%',
'mask': 'no-repeat center / 100%',
'-webkit-mask-image': 'var(--svg)',
'mask-image': 'var(--svg)',
'-webkit-mask-repeat': 'no-repeat',
'mask-repeat': 'no-repeat',
'-webkit-mask-size': '100% 100%',
'mask-size': '100% 100%',
'--svg': data['--svg'],
});
});

File diff suppressed because it is too large Load Diff