javascript.less 908 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. .eval {
  2. js: `42`;
  3. js: `1 + 1`;
  4. js: `"hello world"`;
  5. js: `[1, 2, 3]`;
  6. title: `typeof process.title`;
  7. ternary: `(1 + 1 == 2 ? true : false)`;
  8. multiline: `(function(){var x = 1 + 1;
  9. return x})()`;
  10. }
  11. .scope {
  12. empty: `+function(){}`;
  13. @foo: 42;
  14. var: `parseInt(this.foo.toJS())`;
  15. escaped: ~`2 + 5 + 'px'`;
  16. }
  17. .vars {
  18. @var: `4 + 4`;
  19. width: @var;
  20. }
  21. .escape-interpol {
  22. @world: "world";
  23. width: ~`"hello" + " " + @{world}`;
  24. }
  25. .arrays {
  26. @ary: 1, 2, 3;
  27. @ary2: 1 2 3;
  28. ary: `@{ary}.join(', ')`;
  29. ary1: `@{ary2}.join(', ')`;
  30. }
  31. .transitions(...) {
  32. @arg: ~`"@{arguments}".replace(/[\[\]]*/g, '')`;
  33. 1: @arg; // rounded to integers
  34. 2: ~`"@{arguments}"`; // rounded to integers
  35. 3: @arguments; // OK
  36. }
  37. .test-tran {
  38. .transitions(opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;);
  39. }