File: object.complex.styl

package info (click to toggle)
node-stylus 0.48.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,196 kB
  • ctags: 766
  • sloc: makefile: 38
file content (107 lines) | stat: -rw-r--r-- 1,333 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
foo = { bar: { baz: true } }
prop = 'bar'

.foo
  test: foo[prop]['baz']

blah(str)
  str

foo = { bar: baz }

.foo
  background: blah(foo.bar)

foo = {
  bar: {
    baz: baz
  }
}

foo['bar']['baz'] = {
  bar: baz,
  baz: bar
}

body
  test: foo.bar.baz.baz

bar = 'baz'

obj = { baz: 'bar', bar: 'baz' }

body
  test: obj.bar
  for i in 1..1
    test: obj.bar

foo = {}
foo['a'] = {}
foo['a']['b'] = {}
foo['a']['b']['c'] = 10px

.foo
  test: foo['a']['b']['c']
  test: foo.a.b.c
  test: foo['a'].b.c
  test: foo.a['b'].c
  test: foo.a.b['c']
  test: foo['a']['b'].c
  test: foo.a['b']['c']
  test: foo['a'].b['c']
  test: 'some ' + foo.a.b.c + ' thing'
  test: 'some ' + foo['a']['b']['c'] + ' thing'

foo()
  return 10px

bar = {}

bar["baz"] = {
  raz: foo()
}

body
  width: bar.baz.raz

foo(obj)
  return obj.width

body
  width: foo({ width: 100px })

bar.foo = 10px * 2

if bar.foo {
  bar.qux = { width: 20px * bar.foo }
}

body
  width: bar.qux.width
  height: bar.buz = 100px

foo(obj)
  .foo
    for size, settings in obj
      width = settings.width
      height = settings.height
      width width
      height height

obj = {
  small: {
    width: 10px
    height: 20px
  }
  large: {
    width: 100px
    height: 200px
  }
}

foo(obj)

obj.shadow = 1px 1px -1px 2px rgba(0, 0, 0, 0.5)

body
  box-shadow: obj.shadow