Skip to content

Commit

Permalink
fix: use css vars for icons
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Aug 17, 2023
1 parent 3324b9c commit 63690d2
Show file tree
Hide file tree
Showing 9 changed files with 485 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apps/pink/public/search.json

Large diffs are not rendered by default.

484 changes: 477 additions & 7 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,5 @@
"npm": ">=7.0.0",
"node": ">=16.0.0"
},
"packageManager": "npm@8.1.2",
"dependencies": {
"@appwrite.io/pink-icons": "^0.0.7-next.1"
}
"packageManager": "npm@8.1.2"
}
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "ISC",
"devDependencies": {
"oslllo-svg-fixer": "^2.2.0",
"svgtofont": "^3.22.0"
"svgtofont": "^4.0.0"
},
"main": "dist/icon.css",
"style": "dist/icon.css",
Expand Down
3 changes: 2 additions & 1 deletion packages/icons/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const generateIcons = async () => {
generateInfoData: true,
svgoOptions: {
full: false
}
},
useCSSVars: true
});
}

Expand Down
1 change: 0 additions & 1 deletion packages/icons/templates/__variables.scss.template

This file was deleted.

3 changes: 1 addition & 2 deletions packages/icons/templates/_{{filename}}.css.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
}

[class^="{{prefix}}-"], [class*=" {{prefix}}-"] {
font-family: '{{fontname}}' !important;
font-size: {{fontSize}};
font-family: '{{fontname}}' !important;{{fontSize}}
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down
3 changes: 1 addition & 2 deletions packages/icons/templates/_{{filename}}.scss.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
}

[class^="{{prefix}}-"], [class*=" {{prefix}}-"] {
font-family: '{{fontname}}' !important;
font-size: {{fontSize}};
font-family: '{{fontname}}' !important;{{fontSize}}
font-display: swap;
font-style: normal;
-webkit-font-smoothing: antialiased;
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/6-elements/form/_radio-and-checkbox.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use '../../abstract' as *;
@use '@appwrite.io/pink-icons/dist/variables' as icons;

[type="checkbox"],
[type="radio"] {
Expand Down Expand Up @@ -127,7 +126,7 @@
&:where(:checked) {
&::before {
font-family: 'icon' !important;
content: icons.$icon-check;
content: var(--icon-check);
vertical-align: middle;
margin-bottom: calc(var(--p-size) / 8 * -1);
font-size: var(--p-icon-size);
Expand Down

0 comments on commit 63690d2

Please sign in to comment.