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.

README.md 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # CSS Shorthand Properties
  2. A simple way to list all [shorthand](https://www.w3.org/TR/CSS2/about.html#shorthand) CSS properties and which properties they expand to.
  3. I tried to search for an existing simple list but couldn't find one, so I trawled through the various [W3C CSS specs](https://www.w3.org/Style/CSS/current-work) and collated the data.
  4. Only specs that are Candidate Recommendations or better are counted, with the exception of some Working Drafts that have a lot of traction in browser implementations. So far the WD specs included here are Animation and Transitions.
  5. ## Usage
  6. Available on npm as `css-shorthand-properties`, or in the browser as a global called `cssShorthandProps`
  7. ### Properties
  8. #### shorthandProperties
  9. The core data as a simple JS object. Each key is a CSS shorthand property. Each value is a compacted list of CSS properties that the shorthand expands to.
  10. There is a convenience method (listed below) that means you shouldn’t need to access this list directly, but it’s available for other use cases.
  11. ### Methods
  12. #### isShorthand
  13. * Returns a boolean indicating if a CSS property is a shorthand.
  14. * **Parameters**:
  15. * `property` _(String)_ Shorthand property to expand.
  16. * **Returns**: _Boolean_
  17. ```js
  18. cssShorthandProps.isShorthand('border'); // true
  19. cssShorthandProps.isShorthand('display'); // false
  20. ```
  21. #### expand
  22. * Takes a CSS shorthand property and returns a list of longhand properties.
  23. * **Parameters**:
  24. * `property` _(String)_ Shorthand property to expand.
  25. * `recurse` _(Boolean – optional, default `false`)_ If true, each longhand property will also be run through `expand()`. This is only useful for the `border` property.
  26. * **Returns**: _Array_ with a list of longhand properties that the given property expands to. If the property is not a shorthand, the array contains only the original property.
  27. ```js
  28. // Standard usage
  29. cssShorthandProps.expand('list-style');
  30. // ['list-style-type', 'list-style-position', 'list-style-image']
  31. // Non-shorthand properties return themselves in an array
  32. cssShorthandProps.expand('color');
  33. // ['color']
  34. // Using 'border' in normal mode...
  35. cssShorthandProps.expand('border');
  36. // ['border-width', 'border-style', 'border-color']
  37. // ...but the border properties are also shorthands
  38. cssShorthandProps.expand('border-width');
  39. // ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width']
  40. // Using 'border' with recursion returns an array of arrays
  41. cssShorthandProps.expand('border', true);
  42. /*
  43. [
  44. ['border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'],
  45. ['border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'],
  46. ['border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color']
  47. ]
  48. */
  49. ```
  50. ## Licence
  51. MIT: [https://gilmoreorless.mit-license.org/]()