_functions.scss.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js">@function min($value1, $value2) {
  19. @if $value1 &gt; $value2 {
  20. @return $value2;
  21. }
  22. @else if $value2 &gt; $value1 {
  23. @return $value1;
  24. }
  25. @return $value1;
  26. }
  27. @function max($value1, $value2) {
  28. @if $value1 &gt; $value2 {
  29. @return $value1;
  30. }
  31. @else if $value2 &gt; $value1 {
  32. @return $value2;
  33. }
  34. @return $value1;
  35. }
  36. @function top($box) {
  37. @return parsebox($box, 1);
  38. }
  39. @function right($box) {
  40. @return parsebox($box, 2);
  41. }
  42. @function bottom($box) {
  43. @return parsebox($box, 3);
  44. }
  45. @function left($box) {
  46. @return parsebox($box, 4);
  47. }
  48. @function vertical($box) {
  49. @return top($box) + bottom($box);
  50. }
  51. @function horizontal($box) {
  52. @return left($box) + right($box);
  53. }
  54. @function boxmax($box) {
  55. @return max(max(top($box), right($box)), max(bottom($box), left($box)));
  56. }
  57. @function boxmin($box) {
  58. @return min(min(top($box), right($box)), min(bottom($box), left($box)));
  59. }</pre>
  60. </body>
  61. </html>