javascript.less 880 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. @foo: 42;
  13. var: `parseInt(this.foo.toJS())`;
  14. escaped: ~`2 + 5 + 'px'`;
  15. }
  16. .vars {
  17. @var: `4 + 4`;
  18. width: @var;
  19. }
  20. .escape-interpol {
  21. @world: "world";
  22. width: ~`"hello" + " " + @{world}`;
  23. }
  24. .arrays {
  25. @ary: 1, 2, 3;
  26. @ary2: 1 2 3;
  27. ary: `@{ary}.join(', ')`;
  28. ary1: `@{ary2}.join(', ')`;
  29. }
  30. .transitions(...) {
  31. @arg: ~`"@{arguments}".replace(/[\[\]]*/g, '')`;
  32. 1: @arg; // rounded to integers
  33. 2: ~`"@{arguments}"`; // rounded to integers
  34. 3: @arguments; // OK
  35. }
  36. .test-tran {
  37. .transitions(opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;);
  38. }