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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. PostCSS HTML Syntax
  2. ====
  3. [![NPM version](https://img.shields.io/npm/v/postcss-html.svg?style=flat-square)](https://www.npmjs.com/package/postcss-html)
  4. [![Travis](https://img.shields.io/travis/gucong3000/postcss-html.svg)](https://travis-ci.org/gucong3000/postcss-html)
  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-html.svg)](https://codecov.io/gh/gucong3000/postcss-html)
  7. [![David](https://img.shields.io/david/gucong3000/postcss-html.svg)](https://david-dm.org/gucong3000/postcss-html)
  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](https://github.com/postcss/postcss) syntax for parsing HTML (and HTML-like)
  12. - [PHP](http://php.net)
  13. - [Vue Single-File Component](https://vue-loader.vuejs.org/spec.html)
  14. - [Quick App](https://doc.quickapp.cn/framework/source-file.html)
  15. - [XSLT](https://www.w3.org/TR/xslt-30/)
  16. ## Getting Started
  17. First thing's first, install the module:
  18. ```
  19. npm install postcss-syntax postcss-html --save-dev
  20. ```
  21. If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install the corresponding module.
  22. - SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)
  23. - SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)
  24. - LESS: [postcss-less](https://github.com/shellscape/postcss-less)
  25. - SugarSS: [sugarss](https://github.com/postcss/sugarss)
  26. ## Use Cases
  27. ```js
  28. const postcss = require('postcss');
  29. const syntax = require('postcss-html')({
  30. // syntax for parse scss (non-required options)
  31. scss: require('postcss-scss'),
  32. // syntax for parse less (non-required options)
  33. less: require('postcss-less'),
  34. // syntax for parse css blocks (non-required options)
  35. css: require('postcss-safe-parser'),
  36. });
  37. postcss(plugins).process(source, { syntax: syntax }).then(function (result) {
  38. // An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
  39. result.content
  40. });
  41. ```
  42. If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install these module:
  43. - SCSS: [postcss-scss](https://github.com/postcss/postcss-scss)
  44. - SASS: [postcss-sass](https://github.com/aleshaoleg/postcss-sass)
  45. - LESS: [postcss-less](https://github.com/shellscape/postcss-less)
  46. - SugarSS: [sugarss](https://github.com/postcss/sugarss)
  47. ## Advanced Use Cases
  48. See: [postcss-syntax](https://github.com/gucong3000/postcss-syntax)
  49. ## Turning PostCSS off from within your HTML
  50. PostCSS can be temporarily turned off by using special comments in your HTML. For example:
  51. ```html
  52. <html>
  53. <body>
  54. <!-- postcss-disable -->
  55. <a style="color: red;"></a>
  56. <!-- postcss-enable -->
  57. ```
  58. ## Style Transformations
  59. The main use case of this plugin is to apply PostCSS transformations to `<style>` tags and `<div style="*">` property in HTML (and HTML-like).