Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 36 lines (24 sloc) 0.955 kb

Keyword Arguments

Stylus supports keyword arguments, or "kwargs", allowing you to key arguments by their associated parameter name.

The examples shown below are functionally equivalent, however we can place keyword arguments anywhere within the list. The remaining arguments that are not keyed will be applied to the parameters that have not been satisfied.

  body {
    color: rgba(255, 200, 100, 0.5);
    color: rgba(red: 255, green: 200, blue: 100, alpha: 0.5);
    color: rgba(alpha: 0.5, blue: 100, red: 255, 200);
    color: rgba(alpha: 0.5, blue: 100, 255, 200);
  }

yielding:

   body {
     color: rgba(255,200,100,0.5);
     color: rgba(255,200,100,0.5);
     color: rgba(255,200,100,0.5);
     color: rgba(255,200,100,0.5);
   }

To see what parameters a function or mixin accept, use the p() function:

p(rgba)

yielding:

inspect: rgba(red, green, blue, alpha)
Something went wrong with that request. Please try again.