ant-design/components/_util/isFlexSupported.tsx

13 lines
397 B
TypeScript
Raw Normal View History

2017-02-08 17:15:14 +08:00
export default function isFlexSupported() {
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
const { documentElement } = window.document;
2018-12-07 16:17:45 +08:00
return (
'flex' in documentElement.style ||
2017-02-08 17:15:14 +08:00
'webkitFlex' in documentElement.style ||
'Flex' in documentElement.style ||
2018-12-07 16:17:45 +08:00
'msFlex' in documentElement.style
);
2017-02-08 17:15:14 +08:00
}
return false;
}