mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 21:48:19 +08:00
14 lines
505 B
TypeScript
14 lines
505 B
TypeScript
|
function isStyleSupport(styleName: string | Array<string>): boolean {
|
||
|
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
|
||
|
const styleNameList = Array.isArray(styleName) ? styleName : [styleName];
|
||
|
const { documentElement } = window.document;
|
||
|
|
||
|
return styleNameList.some(name => name in documentElement.style);
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
export const isFlexSupported = isStyleSupport(['flex', 'webkitFlex', 'Flex', 'msFlex']);
|
||
|
|
||
|
export default isStyleSupport;
|