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.

index.js 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*!
  2. * https://github.com/gilmoreorless/css-shorthand-properties
  3. * MIT Licensed: https://gilmoreorless.mit-license.org/
  4. */
  5. (function (exports) {
  6. /**
  7. * Data collated from multiple W3C specs: https://www.w3.org/Style/CSS/current-work
  8. * Only specs that are Candidate Recommendations or better are counted, with the
  9. * exception of some Working Drafts that have a lot of traction in browser implementations.
  10. * So far the WD specs included here are Animation and Transitions.
  11. *
  12. * @type {Object}
  13. */
  14. var props = exports.shorthandProperties = {
  15. // CSS 2.1: https://www.w3.org/TR/CSS2/propidx.html
  16. 'list-style': ['-type', '-position', '-image'],
  17. 'margin': ['-top', '-right', '-bottom', '-left'],
  18. 'outline': ['-width', '-style', '-color'],
  19. 'padding': ['-top', '-right', '-bottom', '-left'],
  20. // CSS Backgrounds and Borders Module Level 3: https://www.w3.org/TR/css3-background/
  21. 'background': ['-image', '-position', '-size', '-repeat', '-origin', '-clip', '-attachment', '-color'],
  22. 'background-position': ['-x', '-y'], // Not found in the spec, but already implemented by every stable browser
  23. 'border': ['-width', '-style', '-color'],
  24. 'border-color': ['border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'],
  25. 'border-style': ['border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'],
  26. 'border-width': ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'],
  27. 'border-top': ['-width', '-style', '-color'],
  28. 'border-right': ['-width', '-style', '-color'],
  29. 'border-bottom': ['-width', '-style', '-color'],
  30. 'border-left': ['-width', '-style', '-color'],
  31. 'border-radius': ['border-top-left-radius', 'border-top-right-radius', 'border-bottom-right-radius', 'border-bottom-left-radius'],
  32. 'border-image': ['-source', '-slice', '-width', '-outset', '-repeat'],
  33. // CSS Fonts Module Level 3: https://www.w3.org/TR/css3-fonts/
  34. 'font': ['-style', '-variant', '-weight', '-stretch', '-size', 'line-height', '-family'],
  35. 'font-variant': ['-ligatures', '-alternates', '-caps', '-numeric', '-east-asian'],
  36. // CSS Flexible Box Layout Module Level 1: https://www.w3.org/TR/css3-flexbox-1/
  37. 'flex': ['-grow', '-shrink', '-basis'],
  38. 'flex-flow': ['flex-direction', 'flex-wrap'],
  39. // CSS Grid Layout Module Level 1: https://www.w3.org/TR/css-grid-1/
  40. 'grid': ['-template-rows', '-template-columns', '-template-areas', '-auto-rows', '-auto-columns', '-auto-flow'],
  41. 'grid-template': ['-rows', '-columns', '-areas'],
  42. 'grid-row': ['-start', '-end'],
  43. 'grid-column': ['-start', '-end'],
  44. 'grid-area': ['grid-row-start', 'grid-column-start', 'grid-row-end', 'grid-column-end'],
  45. 'grid-gap': ['grid-row-gap', 'grid-column-gap'],
  46. // CSS Masking Module Level 1: https://www.w3.org/TR/css-masking/
  47. 'mask': ['-image', '-mode', '-position', '-size', '-repeat', '-origin', '-clip'],
  48. 'mask-border': ['-source', '-slice', '-width', '-outset', '-repeat', '-mode'],
  49. // CSS Multi-column Layout Module: https://www.w3.org/TR/css3-multicol/
  50. 'columns': ['column-width', 'column-count'],
  51. 'column-rule': ['-width', '-style', '-color'],
  52. // CSS Scroll Snap Module Level 1: https://www.w3.org/TR/css-scroll-snap-1/
  53. 'scroll-padding': ['-top', '-right', '-bottom', '-left'],
  54. 'scroll-padding-block': ['-start', '-end'],
  55. 'scroll-padding-inline': ['-start', '-end'],
  56. 'scroll-snap-margin': ['-top', '-right', '-bottom', '-left'],
  57. 'scroll-snap-margin-block': ['-start', '-end'],
  58. 'scroll-snap-margin-inline': ['-start', '-end'],
  59. // CSS Speech Module: https://www.w3.org/TR/css3-speech/
  60. 'cue': ['-before', '-after'],
  61. 'pause': ['-before', '-after'],
  62. 'rest': ['-before', '-after'],
  63. // CSS Text Decoration Module Level 3: https://www.w3.org/TR/css-text-decor-3/
  64. 'text-decoration': ['-line', '-style', '-color'],
  65. 'text-emphasis': ['-style', '-color'],
  66. // CSS Animations (WD): https://www.w3.org/TR/css3-animations
  67. 'animation': ['-name', '-duration', '-timing-function', '-delay', '-iteration-count', '-direction', '-fill-mode', '-play-state'],
  68. // CSS Transitions (WD): https://www.w3.org/TR/css3-transitions/
  69. 'transition': ['-property', '-duration', '-timing-function', '-delay'],
  70. };
  71. /**
  72. * Check if a CSS property is a shorthand value
  73. * @param {string} property CSS property name
  74. * @return {boolean} True if the property is a shorthand value
  75. */
  76. exports.isShorthand = function (property) {
  77. return props.hasOwnProperty(property);
  78. };
  79. /**
  80. * Expand a shorthand property into an array of longhand properties
  81. * @param {string} property CSS property name
  82. * @param {boolean} recurse Expand sub-properties, when applicable - default false
  83. * @return {array} List of longhand properties, or the original property if it's not a shorthand
  84. */
  85. exports.expand = function (property, recurse) {
  86. if (!props.hasOwnProperty(property)) {
  87. return [property];
  88. }
  89. return props[property].map(function (p) {
  90. var longhand = p.substr(0, 1) === '-' ? property + p : p;
  91. return recurse ? exports.expand(longhand, recurse) : longhand;
  92. });
  93. };
  94. })((function (root) {
  95. // CommonJS
  96. if (typeof module !== 'undefined' && module.exports !== undefined) return module.exports;
  97. // Global `cssShorthandProps`
  98. return (root.cssShorthandProps = {});
  99. })(this));