Skip to content

Commit 6816f0f

Browse files
conico974Nicolas Dorseuil
andauthored
Add browserslist and improve CSS masks for compatibility (#3471)
Co-authored-by: Nicolas Dorseuil <nicolas@gitbook.io>
1 parent 1738677 commit 6816f0f

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.changeset/gold-sheep-obey.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"gitbook": patch
3+
"@gitbook/icons": patch
4+
---
5+
6+
add browserlists and fix old browser css-masks

packages/gitbook/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,8 @@
111111
"e2e-customers": "playwright test e2e/customers.spec.ts",
112112
"unit": "bun test {src,packages} --preload ./tests/preload-bun.ts",
113113
"typecheck": "tsc --noEmit"
114-
}
114+
},
115+
"browserslist": [
116+
">0.3%, chrome >= 64, edge >= 79, firefox >= 67, opera >= 51, safari >= 12 and not dead"
117+
]
115118
}

packages/icons/src/Icon.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ export const Icon = React.forwardRef(function Icon(
5858
{...rest}
5959
style={{
6060
maskImage: `url(${url})`,
61+
//@ts-ignore // For compatibility with older browsers
62+
'-webkit-mask-image': `url(${url})`,
6163
maskRepeat: 'no-repeat',
64+
'-webkit-mask-repeat': 'no-repeat',
6265
maskPosition: 'center',
66+
'-webkit-mask-position': 'center',
6367
...(size ? { width: size, height: size } : {}),
6468
...rest.style,
6569
}}

0 commit comments

Comments
 (0)