"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = supportsCSS;

/**
 * 检查浏览器是否支持某项 CSS 属性
 * @param {string} attribute 需要查询的 CSS 属性
 * @param {string} value 需要查询的 CSS 属性值
 * @return {Boolean}
 */
function supportsCSS(attribute, value) {
  if (window.CSS && window.CSS.supportsCSS) {
    var nativeSupportsCSS = window.CSS.supportsCSS;
    if (typeof value === 'undefined') return nativeSupportsCSS(attribute);
    return nativeSupportsCSS(attribute, value);
  }

  var elem = document.createElement('div');

  if (attribute in elem.style) {
    elem.style[attribute] = value;
    return elem.style[attribute] === value;
  }

  return false;
}

module.exports = exports.default;