Skip to content

Commit

Permalink
fix(future/Icon): copy CDN styles to internal styles (#5241)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartSquared authored Nov 8, 2024
1 parent 75c06ad commit 8393cc8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/afraid-schools-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/components": patch
---

Update future Icon to only use internal styles as opposed to global styles from the CDN.
6 changes: 6 additions & 0 deletions .stylelintrc-css.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ export default {
rules: {
"selector-class-pattern": null,
"color-function-notation": ["modern", { ignore: ["with-var-inside"] }],
"font-family-no-missing-generic-family-keyword": [
true,
{
ignoreFontFamilies: ["Material Symbols Outlined"],
},
],
},
}
18 changes: 18 additions & 0 deletions packages/components/src/__future__/Icon/Icon.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* This is taken from the Material Symbols CDN
* font-weight & font-size removed as overridden in .icon
*/
.material-symbols-outlined {
font-family: "Material Symbols Outlined";
font-style: normal;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
font-feature-settings: "liga";
-webkit-font-smoothing: antialiased;
}

.icon {
font-size: calc(1px * var(--icon-size, 20));
font-weight: var(--icon-font-weight, 400);
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/__future__/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const MaterialIcon = ({
}: MaterialIconProps): JSX.Element => (
<span
className={classNames(
"material-symbols-outlined",
styles["material-symbols-outlined"],
styles.icon,
isFilled && styles.filled,
className
Expand Down

0 comments on commit 8393cc8

Please sign in to comment.