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.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. PostCSS Syntax
  2. ====
  3. [![NPM version](https://img.shields.io/npm/v/postcss-syntax.svg?style=flat-square)](https://www.npmjs.com/package/postcss-syntax)
  4. [![Travis](https://img.shields.io/travis/gucong3000/postcss-syntax.svg)](https://travis-ci.org/gucong3000/postcss-syntax)
  5. [![Travis](https://img.shields.io/travis/gucong3000/postcss-syntaxes.svg?label=integration)](https://travis-ci.org/gucong3000/postcss-syntaxes)
  6. [![Codecov](https://img.shields.io/codecov/c/github/gucong3000/postcss-syntax.svg)](https://codecov.io/gh/gucong3000/postcss-syntax)
  7. [![David](https://img.shields.io/david/dev/gucong3000/postcss-syntax.svg)](https://david-dm.org/gucong3000/postcss-syntax?type=dev)
  8. <img align="right" width="95" height="95"
  9. title="Philosopher’s stone, logo of PostCSS"
  10. src="http://postcss.github.io/postcss/logo.svg">
  11. postcss-syntax can automatically switch the required [PostCSS](https://github.com/postcss/postcss) syntax by file extension/source
  12. ## Getting Started
  13. First thing's first, install the module:
  14. ```
  15. npm install postcss-syntax --save-dev
  16. ```
  17. If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install these module:
  18. - SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)
  19. - SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)
  20. - LESS: [postcss-less](https://github.com/shellscape/postcss-less)
  21. - SugarSS: [sugarss](https://github.com/postcss/sugarss)
  22. If you want support HTML (and HTML-like)/Markdown/CSS-in-JS file format, you need to install these module:
  23. - CSS-in-JS: [postcss-jsx](https://github.com/gucong3000/postcss-jsx)
  24. - HTML (and HTML-like): [postcss-html](https://github.com/gucong3000/postcss-html)
  25. - Markdown: [postcss-markdown](https://github.com/gucong3000/postcss-markdown)
  26. ## Use Cases
  27. ```js
  28. const postcss = require('postcss');
  29. const syntax = require('postcss-syntax')({
  30. rules: [
  31. {
  32. test: /\.(?:[sx]?html?|[sx]ht|vue|ux|php)$/i,
  33. extract: 'html',
  34. },
  35. {
  36. test: /\.(?:markdown|md)$/i,
  37. extract: 'markdown',
  38. },
  39. {
  40. test: /\.(?:m?[jt]sx?|es\d*|pac)$/i,
  41. extract: 'jsx',
  42. },
  43. {
  44. // custom language for file extension
  45. test: /\.postcss$/i,
  46. lang: 'scss'
  47. },
  48. {
  49. // custom language for file extension
  50. test: /\.customcss$/i,
  51. lang: 'custom'
  52. },
  53. ],
  54. // custom parser for CSS (using `postcss-safe-parser`)
  55. css: 'postcss-safe-parser',
  56. // custom parser for SASS (PostCSS-compatible syntax.)
  57. sass: require('postcss-sass'),
  58. // custom parser for SCSS (by module name)
  59. scss: 'postcss-scss',
  60. // custom parser for LESS (by module path)
  61. less: './node_modules/postcss-less',
  62. // custom parser for SugarSS
  63. sugarss: require('sugarss'),
  64. // custom parser for custom language
  65. custom: require('postcss-custom-syntax'),
  66. });
  67. postcss(plugins).process(source, { syntax: syntax }).then(function (result) {
  68. // An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
  69. result.content
  70. });
  71. ```