Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

isAutoprefixable.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. 'use strict';
  2. const autoprefixer = require('autoprefixer');
  3. const Browsers = require('autoprefixer/lib/browsers');
  4. const Prefixes = require('autoprefixer/lib/prefixes');
  5. /**
  6. * Use Autoprefixer's secret powers to determine whether or
  7. * not a certain CSS identifier contains a vendor prefix that
  8. * Autoprefixer, given the standardized identifier, could add itself.
  9. *
  10. * Used by `*-no-vendor-prefix-*` rules to find superfluous
  11. * vendor prefixes.
  12. */
  13. const prefixes = new Prefixes(
  14. autoprefixer.data.prefixes,
  15. new Browsers(autoprefixer.data.browsers, []),
  16. );
  17. /**
  18. * Most identifier types have to be looked up in a unique way,
  19. * so we're exposing special functions for each.
  20. */
  21. module.exports = {
  22. /**
  23. * @param {string} identifier
  24. * @returns {boolean}
  25. */
  26. atRuleName(identifier) {
  27. return Boolean(prefixes.remove[`@${identifier.toLowerCase()}`]);
  28. },
  29. /**
  30. * @param {string} identifier
  31. * @returns {boolean}
  32. */
  33. selector(identifier) {
  34. return prefixes.remove.selectors.some((/** @type {{ prefixed: string}} */ selectorObj) => {
  35. return identifier.toLowerCase() === selectorObj.prefixed;
  36. });
  37. },
  38. /**
  39. * @param {string} identifier
  40. * @returns {boolean}
  41. */
  42. mediaFeatureName(identifier) {
  43. return identifier.toLowerCase().includes('device-pixel-ratio');
  44. },
  45. /**
  46. * @param {string} identifier
  47. * @returns {boolean}
  48. */
  49. property(identifier) {
  50. return Boolean(autoprefixer.data.prefixes[prefixes.unprefixed(identifier.toLowerCase())]);
  51. },
  52. /**
  53. *
  54. * @param {string} prop
  55. * @param {string} value
  56. * @returns {boolean}
  57. */
  58. propertyValue(prop, value) {
  59. const possiblePrefixableValues =
  60. (prefixes.remove[prop.toLowerCase()] && prefixes.remove[prop.toLowerCase()].values) || false;
  61. return (
  62. possiblePrefixableValues &&
  63. possiblePrefixableValues.some((/** @type {{ prefixed: string}} */ valueObj) => {
  64. return value.toLowerCase() === valueObj.prefixed;
  65. })
  66. );
  67. },
  68. /**
  69. *
  70. * @param {string} value
  71. * @returns {string}
  72. */
  73. unprefix(value) {
  74. return value.replace(/-\w+-/, '');
  75. },
  76. };