From 483af9ac319d691c4868def66433839268136919 Mon Sep 17 00:00:00 2001 From: B Mathis Date: Sat, 21 Nov 2009 11:11:34 -0600 Subject: [PATCH] added linear gradient mixin --- .../stylesheets/compass/css3/_gradient.sass | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/compass/frameworks/compass/stylesheets/compass/css3/_gradient.sass diff --git a/lib/compass/frameworks/compass/stylesheets/compass/css3/_gradient.sass b/lib/compass/frameworks/compass/stylesheets/compass/css3/_gradient.sass new file mode 100644 index 00000000..b8cc79f8 --- /dev/null +++ b/lib/compass/frameworks/compass/stylesheets/compass/css3/_gradient.sass @@ -0,0 +1,19 @@ +=gradient(!type, !coords, !color_start, !color_end, !stop_1 = 0, !stop_1_pos = .3, !stop_2 = 0, !stop_2_pos = .6, !stop_3 = 0, !stop_3_pos = .9) + !gradient: #{!coords}, from(#{!color_start}), to(#{!color_end}) + @if !stop_1 != 0 + !gradient= !gradient + color-stop(#{!stop_1_pos}, #{!stop_1}) + @if !stop_2 != 0 + !gradient= !gradient + color-stop(#{!stop_2_pos}, #{!stop_2}) + @if !stop_3 != 0 + !gradient= !gradient + color-stop(#{!stop_3_pos}, #{!stop_3}) + background: -webkit-gradient(#{!type}, #{!gradient}) + background: -moz-#{!type}-gradient(#{!gradient}) + +=linear-gradient(!coords, !color1, !color2) + +gradient("linear", !coords, !color1, !color2) + +=v-gradient(!color1, !color2) + =linear-gradient("left top, left bottom", !color1, !color2) + +=h-gradient(!color1, !color2) + =linear-gradient("left top, right top", !color1, !color2) \ No newline at end of file