@uifabric/merge-styles
Version:
Style loading utilities.
33 lines • 1.27 kB
JavaScript
var _vendorSettings;
export function getVendorSettings() {
var _a, _b;
if (!_vendorSettings) {
var doc = typeof document !== 'undefined' ? document : undefined;
var nav = typeof navigator !== 'undefined' ? navigator : undefined;
var userAgent = (_b = (_a = nav) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.toLowerCase();
if (!doc) {
_vendorSettings = {
isWebkit: true,
isMoz: true,
isOpera: true,
isMs: true,
};
}
else {
_vendorSettings = {
isWebkit: !!(doc && 'WebkitAppearance' in doc.documentElement.style),
isMoz: !!(userAgent && userAgent.indexOf('firefox') > -1),
isOpera: !!(userAgent && userAgent.indexOf('opera') > -1),
isMs: !!(nav && (/rv:11.0/i.test(nav.userAgent) || /Edge\/\d./i.test(navigator.userAgent))),
};
}
}
return _vendorSettings;
}
/**
* Sets the vendor settings for prefixing and vendor specific operations.
*/
export function setVendorSettings(vendorSettings) {
_vendorSettings = vendorSettings;
}
//# sourceMappingURL=getVendorSettings.js.map