View Full Version : What is the correct syntax for linear-gradient?

31 Jul 2013, 7:10 AM
I want to create a simple gradient for panel headers. I used the function described at the bottom of this page: http://docs.sencha.com/extjs/4.2.0/#!/api/Global_CSS-css_mixin-background-gradient

But I modified it like this:

@function linear-gradient-simple ($color1, $color2) {
@return linear-gradient (top, color_stops($color1 0%, $color2 100%));

When I compile, I get the error "Wrong number of arguments (3 for 2) for 'linear-gradient')

I only have 2 arguments, just like in the example. What did I do wrong?

1 Aug 2013, 11:36 AM
I've gotten closer to solving this mystery.

In ext-base and ext-classic, I saw that the following syntax was used:

$ui-body-background-gradient: 'grid-header'

But this still doesn't tell me how to pass parameters. I've tried 'grid-header(top,#dfdfdf)', the same thing without the quotes, and putting the function name in quotes with the parameters outside. The first two compiled but were ignored. The third caused an error.

The SASS reference (http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#function_directives) says that I should be able to use this syntax for a function:

$ui-body-background-gradient: grid-header(top, #dfdfdf)

But this doesn't work in ExtJs 4.2.