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.

import.js 691B

1234567891011121314151617181920212223242526272829
  1. /* eslint no-param-reassign: off */
  2. const tokenize = require('postcss/lib/tokenize');
  3. const urlPattern = /^url\((.+)\)/;
  4. module.exports = (node) => {
  5. const { name, params = '' } = node;
  6. if (name === 'import' && params.length) {
  7. node.import = true;
  8. const tokenizer = tokenize({ css: params });
  9. node.filename = params.replace(urlPattern, '$1');
  10. while (!tokenizer.endOfFile()) {
  11. const [type, content] = tokenizer.nextToken();
  12. if (type === 'word' && content === 'url') {
  13. return;
  14. } else if (type === 'brackets') {
  15. node.options = content;
  16. node.filename = params.replace(content, '').trim();
  17. break;
  18. }
  19. }
  20. }
  21. };