File: bifs.image-size.styl

package info (click to toggle)
node-stylus 0.54.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 5,392 kB
  • ctags: 913
  • sloc: makefile: 38
file content (34 lines) | stat: -rw-r--r-- 653 bytes parent folder | download | duplicates (3)
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

width(img)
  return image-size(img)[0]

height(img)
  return image-size(img)[1]

body
  foo image-size('gif')
  foo image-size('gif')[0] == width('gif')
  foo image-size('gif')[1] == height('gif')

body
  foo image-size('tux.png')
  foo image-size('tux.png')
  bar image-size('flowers.jpeg')
  bar image-size('flowers_p.jpg')
  baz image-size('tiger.svg')

body
  foo image-size('foo.png', true)

// Checking for the file, so we could do a fallback
body.tux
  if image-size('tux.png', true)
    background: url('tux.png')
  else
    background: lime

body.foo
  if image-size('foo.png', true)
    background: url('foo.png')
  else
    background: lime