builtins.less 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // builtin
  2. @something: "hello world";
  3. @color: #112233;
  4. @color2: rgba(44,55,66, .6);
  5. body {
  6. color: @something;
  7. @num: 7 / 6;
  8. height: @num + 4;
  9. height: floor(@num) + 4px;
  10. height: ceil(@num) + 4px;
  11. @num2: 2 / 3;
  12. width: @num2;
  13. width: round(@num2);
  14. width: floor(@num2);
  15. width: ceil(@num2);
  16. width: round(10px / 3);
  17. color: rgbahex(@color);
  18. color: rgbahex(@color2);
  19. color: argb(@color2);
  20. }
  21. format {
  22. @r: 32;
  23. format: %("rgb(%d, %d, %d)", @r, 128, 64);
  24. format-string: %("hello %s", "world");
  25. format-multiple: %("hello %s %d", "earth", 2);
  26. format-url-encode: %('red is %A', #ff0000);
  27. eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64));
  28. }
  29. #functions {
  30. str: isstring("hello");
  31. str: isstring(one, two);
  32. num: isnumber(2323px);
  33. num: isnumber(2323);
  34. num: isnumber(4/5);
  35. num: isnumber("hello");
  36. col: iscolor(red);
  37. col: iscolor(hello);
  38. col: iscolor(rgba(0,0,0,0.3));
  39. col: iscolor(#fff);
  40. key: iskeyword(hello);
  41. key: iskeyword(3D);
  42. px: ispixel(10px);
  43. px: ispixel(10);
  44. per: ispercentage(10%);
  45. per: ispercentage(10);
  46. em: isem(10em);
  47. em: isem(10);
  48. }