Debian Codegraph @

sass-spec/spec/basic/15_arithmetic_and_lists/input.scss

raw
1 $stuff: 1 2 3;
2
3 $three: 3;
4
5 div {
6 a: 1 + 2;
7 b: 3 + 3/4;
8 c: 1/2 + 1/2;
9 /* shouldn't eval the following "300" */
10 d: 300;
11 /* increasingly jacked-up edge cases that combine arithmetic with lists */
12 e: 1 + (5/10 2 3);
13 f: 1 + ((2+(3 4) 5) 6);
14 g: 1 + ((1+(14/7 8) 9) 6);
15 /* shouldn't perform the following division */
16 h: 15 / 3 / 5;
17 /* should perform the following division now */
18 i: (15 / 3 / 5);
19 /* this too */
20 j: (15 / 3) / 5;
21 /* and this */
22 k: 15 / $three;
23 l: 15 / 5 / $three;
24 m: 1/2, $stuff url("www.foo.com/blah.png") blah blah;
25 n: 1 2 3, $stuff 4 5 (6, 7 8 9);
26 o: 3px + 3px + 3px;
27 p: 4 + 1px;
28 q: (20pt / 10pt);
29 r: 16em * 4;
30 s: (5em / 2);
31 t: 1 + (2 + (3/4 + (4/5 6/7)));
32
33 // Arithmetic operations in Sass should never fail, since we implicitly use
34 // floating-point for all numbers.
35 one-over-zero: (1 / 0);
36 zero-over-zero: (0 / 0);
37 one-mod-zero: 1 % 0;
38 zero-mod-zero: 0 % 0;
39 }