Sha256: e2d8aa775f5cc425bbd685a70c7ad91211a5f276c1ab417bcee45a70f2cbdecd

Contents?: true

Size: 1.45 KB

Versions: 24

Compression:

Stored size: 1.45 KB

Contents

mixin()
  if true
    foo 6
    foo 7 if true
    foo 8 unless true

body
  foo 1
  foo 2 if true
  foo 3 unless false
  if true
    foo 4
    foo 5
  mixin()

body
  foo 1 if false
  foo 2 unless true
  foo 3

above-5(n)
  true if n > 5

body
  foo above-5(2) == null
  foo above-5(6) == true

below-5(n)
  return true unless n > 5
  false

body
  foo below-5(3) == true
  foo below-5(7) == false

body
  foo 5 unless 5 + 5 == 10

body
  foo 5 if 5 + 5 == 10 and true

mixin()
  foo bar
  foo baz

body
  mixin() if true
  mixin() unless true

body
  mixin test if true


@import 'foo.css' if true
@charset 'foo' if false

num = 5 unless num is defined

body
  foo num

type(arg = null)
  return string if arg is a 'string'
  return number if arg is a 'unit'
  unknown

body
  foo type('test')
  foo type(12)
  foo type()

is-a-string(arg = null)
  arg is a 'string' unless arg == null

body
  foo is-a-string() == null
  foo is-a-string('test')
  foo is-a-string(12) if true

empty(expr)
  0 == length(expr)

font-list = arial, sans-serif
body
  fonts font-list unless empty(font-list)
  font-list = ()
  fonts font-list unless empty(font-list)

truthy(val)
  yes if 1 == val or 'yes' == val or 'y' == val

body
  foo truthy(1)
  foo truthy('yes')
  foo truthy('y')
  foo truthy(0)
  foo truthy('no')

negative(n)
  return invalid unless n is a 'unit'
  return yes if n < 0
  return no if n > 0
  zero

body
  foo negative(-5)
  foo negative(5)
  foo negative(0)
  foo negative('asdf')

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
stylus-source-0.23.0 vendor/test/cases/if.postfix.styl
stylus-source-0.22.6 vendor/test/cases/if.postfix.styl
stylus-source-0.22.5 vendor/test/cases/if.postfix.styl
stylus-source-0.22.4 vendor/test/cases/if.postfix.styl
stylus-source-0.22.3 vendor/test/cases/if.postfix.styl
stylus-source-0.22.2 vendor/test/cases/if.postfix.styl
stylus-source-0.22.1 vendor/test/cases/if.postfix.styl
stylus-source-0.22.0 vendor/test/cases/if.postfix.styl
stylus-source-0.21.2 vendor/test/cases/if.postfix.styl
stylus-source-0.21.1 vendor/test/cases/if.postfix.styl
stylus-source-0.21.0 vendor/test/cases/if.postfix.styl
stylus-source-0.20.1 vendor/test/cases/if.postfix.styl
stylus-source-0.20.0 vendor/test/cases/if.postfix.styl
stylus-source-0.19.8 vendor/test/cases/if.postfix.styl
stylus-source-0.19.7 vendor/test/cases/if.postfix.styl
stylus-source-0.19.6 vendor/test/cases/if.postfix.styl
stylus-source-0.19.5 vendor/test/cases/if.postfix.styl
stylus-source-0.19.4 vendor/test/cases/if.postfix.styl
stylus-source-0.19.3 vendor/test/cases/if.postfix.styl
stylus-source-0.19.2 vendor/test/cases/if.postfix.styl