compass 0.11.beta.5 → 0.11.beta.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/frameworks/compass/stylesheets/compass/css3/_images.scss +29 -3
- data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +7 -4
- data/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +0 -2
- data/lib/compass/app_integration/rails.rb +22 -3
- data/lib/compass/commands/sprite.rb +2 -5
- data/lib/compass/compiler.rb +7 -3
- data/lib/compass/configuration/helpers.rb +3 -2
- data/lib/compass/sass_extensions/functions/constants.rb +7 -0
- data/lib/compass/sass_extensions/functions/cross_browser_support.rb +31 -0
- data/lib/compass/sass_extensions/functions/gradient_support.rb +77 -44
- data/lib/compass/sass_extensions/functions/lists.rb +3 -2
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +6 -2
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +8 -2
- data/lib/compass/sass_extensions/sprites/sprites.rb +1 -1
- data/test/fixtures/stylesheets/compass/css/fonts.css +0 -1
- data/test/fixtures/stylesheets/compass/css/gradients.css +70 -12
- data/test/fixtures/stylesheets/compass/css/pie.css +1 -0
- data/test/fixtures/stylesheets/compass/css/sprites.css +1262 -0
- data/test/fixtures/stylesheets/compass/css/utilities.css +3 -0
- data/test/fixtures/stylesheets/compass/images/flag-03c3b29b35.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ad.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ae.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/af.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ag.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ai.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/al.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/am.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/an.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ao.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ar.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/as.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/at.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/au.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/aw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ax.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/az.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ba.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/be.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/br.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/by.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ca.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/catalonia.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ch.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ci.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ck.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/co.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cx.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/de.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/do.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ec.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ee.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/eg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/eh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/england.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/er.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/es.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/et.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/europeanunion.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fam.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ga.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ge.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ht.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/id-2.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ie.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/il.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/in.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/io.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/iq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ir.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/is.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/it.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ke.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ki.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/km.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ky.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/la.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/li.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ls.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ly.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ma.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/md.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/me.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ml.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ms.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mx.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/my.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/na.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ne.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ng.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ni.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/no.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/np.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/om.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pe.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ph.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ps.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/py.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/qa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/re.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ro.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/rs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ru.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/rw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/scotland.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/se.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/si.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/so.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/st.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/td.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/th.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/to.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ua.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ug.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/um.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/us.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/uy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/uz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/va.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ve.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/wales.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/wf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ws.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ye.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/yt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/za.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/zm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/zw.png +0 -0
- data/test/fixtures/stylesheets/compass/sass/gradients.sass +5 -2
- data/test/fixtures/stylesheets/compass/sass/sprites.scss +13 -0
- data/test/sass_extensions_test.rb +6 -0
- metadata +502 -2
data/VERSION.yml
CHANGED
@@ -16,15 +16,36 @@
|
|
16
16
|
$backgrounds: compact($background-1, $background-2, $background-3, $background-4, $background-5,
|
17
17
|
$background-6, $background-7, $background-8, $background-9, $background-10);
|
18
18
|
$mult-bgs: -compass-list-size($backgrounds) > 1;
|
19
|
-
$simple-background: if($mult-bgs or prefixed(-css2, $backgrounds), -css2(-compass-nth($backgrounds, last)), false);
|
20
|
-
@if not blank($simple-background) { background: $simple-background; }
|
21
19
|
@if $experimental-support-for-svg and prefixed(-svg, $backgrounds) { background: -svg($backgrounds); }
|
22
20
|
@if $experimental-support-for-webkit and prefixed(-webkit, $backgrounds) { background: -webkit($backgrounds); }
|
23
21
|
@if $experimental-support-for-mozilla and prefixed(-moz, $backgrounds) { background: -moz($backgrounds); }
|
22
|
+
@if $experimental-support-for-opera and prefixed(-o, $backgrounds) { background: -o($backgrounds); }
|
24
23
|
@if $experimental-support-for-pie and (prefixed(-pie, $backgrounds) or $mult-bgs) { -pie-background: -pie($backgrounds); }
|
25
24
|
background: $backgrounds;
|
26
25
|
}
|
27
26
|
|
27
|
+
@mixin background-with-css2-fallback(
|
28
|
+
$background-1,
|
29
|
+
$background-2: false,
|
30
|
+
$background-3: false,
|
31
|
+
$background-4: false,
|
32
|
+
$background-5: false,
|
33
|
+
$background-6: false,
|
34
|
+
$background-7: false,
|
35
|
+
$background-8: false,
|
36
|
+
$background-9: false,
|
37
|
+
$background-10: false
|
38
|
+
) {
|
39
|
+
$backgrounds: compact($background-1, $background-2, $background-3, $background-4, $background-5,
|
40
|
+
$background-6, $background-7, $background-8, $background-9, $background-10);
|
41
|
+
$mult-bgs: -compass-list-size($backgrounds) > 1;
|
42
|
+
$simple-background: if($mult-bgs or prefixed(-css2, $backgrounds), -css2(-compass-nth($backgrounds, last)), false);
|
43
|
+
@if not blank($simple-background) { background: $simple-background; }
|
44
|
+
@include background($background-1, $background-2, $background-3, $background-4, $background-5,
|
45
|
+
$background-6, $background-7, $background-8, $background-9, $background-10);
|
46
|
+
}
|
47
|
+
|
48
|
+
|
28
49
|
// Background image property support for vendor prefixing within values.
|
29
50
|
@mixin background-image(
|
30
51
|
$image-1,
|
@@ -43,7 +64,8 @@
|
|
43
64
|
@if $experimental-support-for-svg and prefixed(-svg, $images) { background-image: -svg($images); background-size: 100%; }
|
44
65
|
@if $experimental-support-for-webkit and prefixed(-webkit, $images) { background-image: -webkit($images); }
|
45
66
|
@if $experimental-support-for-mozilla and prefixed(-moz, $images) { background-image: -moz($images); }
|
46
|
-
@if $experimental-support-for-
|
67
|
+
@if $experimental-support-for-opera and prefixed(-o, $images) { background-image: -o($images); }
|
68
|
+
@if $experimental-support-for-pie and (prefixed(-pie, $images) or -compass-list-size($images) > 1) { @warn "PIE does not support background-image. Use @include background(#{$images}) instead." }
|
47
69
|
background-image: $images ;
|
48
70
|
}
|
49
71
|
|
@@ -67,6 +89,7 @@
|
|
67
89
|
@mixin border-image($value) {
|
68
90
|
@if $experimental-support-for-mozilla { -moz-border-image: -moz(-compass-list($value)); }
|
69
91
|
@if $experimental-support-for-webkit { -webkit-border-image: -webkit(-compass-list($value)); }
|
92
|
+
@if $experimental-support-for-opera { -o-border-image: -o(-compass-list($value)); }
|
70
93
|
@if $experimental-support-for-svg { border-image: -svg(-compass-list($value)); }
|
71
94
|
border-image: $value;
|
72
95
|
}
|
@@ -75,6 +98,7 @@
|
|
75
98
|
@mixin list-style-image($image) {
|
76
99
|
@if $experimental-support-for-mozilla and prefixed(-moz, $image) { list-style-image: -moz($image); }
|
77
100
|
@if $experimental-support-for-webkit and prefixed(-webkit, $image) { list-style-image: -webkit($image); }
|
101
|
+
@if $experimental-support-for-opera and prefixed(-o, $image) { list-style-image: -o($image); }
|
78
102
|
@if $experimental-support-for-svg and prefixed(-svg, $image) { list-style-image: -svg($image); }
|
79
103
|
list-style-image: $image ;
|
80
104
|
}
|
@@ -84,6 +108,7 @@
|
|
84
108
|
$value: -compass-list($value);
|
85
109
|
@if $experimental-support-for-mozilla and prefixed(-moz, $value) { list-style-image: -moz($value); }
|
86
110
|
@if $experimental-support-for-webkit and prefixed(-webkit, $value) { list-style-image: -webkit($value); }
|
111
|
+
@if $experimental-support-for-opera and prefixed(-o, $value) { list-style-image: -o($value); }
|
87
112
|
@if $experimental-support-for-svg and prefixed(-svg, $value) { list-style-image: -svg($value); }
|
88
113
|
list-style-image: $value ;
|
89
114
|
}
|
@@ -93,6 +118,7 @@
|
|
93
118
|
$value: -compass-list($value);
|
94
119
|
@if $experimental-support-for-mozilla and prefixed(-moz, $value) { content: -moz($value); }
|
95
120
|
@if $experimental-support-for-webkit and prefixed(-webkit, $value) { content: -webkit($value); }
|
121
|
+
@if $experimental-support-for-opera and prefixed(-o, $value) { content: -o($value); }
|
96
122
|
@if $experimental-support-for-svg and prefixed(-svg, $value) { content: -svg($value); }
|
97
123
|
content: $value ;
|
98
124
|
}
|
@@ -1,3 +1,6 @@
|
|
1
|
+
// Determines those states for which you want to enable magic sprite selectors
|
2
|
+
$sprite-selectors: hover, target, active !default;
|
3
|
+
|
1
4
|
// Set the width and height of an element to the original
|
2
5
|
// dimensions of an image before it was included in the sprite.
|
3
6
|
@mixin sprite-dimensions($map, $sprite) {
|
@@ -22,16 +25,17 @@
|
|
22
25
|
@if $dimensions {
|
23
26
|
@include sprite-dimensions($map, $sprite);
|
24
27
|
}
|
28
|
+
@include sprite-selectors($map, $sprite, $sprite);
|
25
29
|
}
|
26
30
|
|
27
31
|
// Include the selectors for the `$sprite` given the `$map` and the
|
28
32
|
// `$full-sprite-name`
|
29
33
|
// @private
|
30
|
-
@mixin
|
34
|
+
@mixin sprite-selectors($map, $sprite-name, $full-sprite-name) {
|
31
35
|
@each $selector in $sprite-selectors {
|
32
36
|
@if sprite_has_selector($map, $sprite-name, $selector) {
|
33
|
-
|
34
|
-
|
37
|
+
&:#{$selector}, &.#{$full-sprite-name}_#{$selector}, &.#{$full-sprite-name}-#{$selector} {
|
38
|
+
@include sprite-background-position($map, "#{$sprite-name}_#{$selector}");
|
35
39
|
}
|
36
40
|
}
|
37
41
|
}
|
@@ -51,7 +55,6 @@
|
|
51
55
|
@if $base-class { @extend #{$base-class}; }
|
52
56
|
@include sprite($map, $sprite-name, $dimensions);
|
53
57
|
}
|
54
|
-
@include sprite_selectors($map, $sprite-name, $full-sprite-name);
|
55
58
|
}
|
56
59
|
}
|
57
60
|
}
|
@@ -24,8 +24,6 @@ $sprite-image-default-width: $sprite-default-size !default;
|
|
24
24
|
|
25
25
|
$sprite-image-default-height: $sprite-default-size !default;
|
26
26
|
|
27
|
-
$sprite-selectors: hover, target, active !default;
|
28
|
-
|
29
27
|
// Sets all the rules for a sprite from a given sprite image to show just one of the sprites.
|
30
28
|
// To reduce duplication use a sprite-bg mixin for common properties and a sprite-select mixin for positioning.
|
31
29
|
@mixin sprite-img($img, $col, $row: 1, $width: $sprite-image-default-width, $height: $sprite-image-default-height, $margin: $sprite-default-margin) {
|
@@ -11,6 +11,14 @@ module Compass
|
|
11
11
|
|
12
12
|
extend self
|
13
13
|
|
14
|
+
def booted!
|
15
|
+
Compass::AppIntegration::Rails.const_set(:BOOTED, true)
|
16
|
+
end
|
17
|
+
|
18
|
+
def booted?
|
19
|
+
defined?(Compass::AppIntegration::Rails::BOOTED) && Compass::AppIntegration::Rails::BOOTED
|
20
|
+
end
|
21
|
+
|
14
22
|
def installer(*args)
|
15
23
|
Installer.new(*args)
|
16
24
|
end
|
@@ -21,13 +29,19 @@ module Compass
|
|
21
29
|
end
|
22
30
|
|
23
31
|
def env
|
24
|
-
|
25
|
-
|
32
|
+
env_production? ? :production : :development
|
33
|
+
end
|
34
|
+
|
35
|
+
def env_production?
|
36
|
+
if defined?(::Rails) && ::Rails.respond_to?(:env)
|
37
|
+
::Rails.env.production?
|
38
|
+
elsif defined?(RAILS_ENV)
|
39
|
+
RAILS_ENV == "production"
|
26
40
|
end
|
27
41
|
end
|
28
42
|
|
29
43
|
def root
|
30
|
-
if defined?(::Rails)
|
44
|
+
if defined?(::Rails) && ::Rails.respond_to?(:root)
|
31
45
|
::Rails.root
|
32
46
|
elsif defined?(RAILS_ROOT)
|
33
47
|
RAILS_ROOT
|
@@ -35,6 +49,11 @@ module Compass
|
|
35
49
|
end
|
36
50
|
|
37
51
|
def initialize!(config = nil)
|
52
|
+
if booted?
|
53
|
+
Compass::Util.compass_warn("Warning: Compass was booted twice. Compass has a Railtie now; please remove your intializer.")
|
54
|
+
else
|
55
|
+
booted!
|
56
|
+
end
|
38
57
|
config ||= Compass.detect_configuration_file(root)
|
39
58
|
Compass.add_project_configuration(config, :project_type => :rails)
|
40
59
|
Compass.discover_extensions!
|
@@ -38,14 +38,11 @@ module Compass
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def perform
|
41
|
-
sprites = Compass::Sprites.new
|
42
41
|
relative_uri = options[:uri].gsub(/^#{Compass.configuration.images_dir}\//, '')
|
43
|
-
|
44
|
-
image_names = sprite_images.map{|i| File.basename(i, '.png')}
|
45
|
-
sprites.path, sprites.name = Compass::Sprites.path_and_name(relative_uri)
|
42
|
+
sprites = Compass::SpriteMap.new(relative_uri, Compass.sass_engine_options)
|
46
43
|
options[:output_file] ||= File.join(Compass.configuration.sass_path, "sprites", "_#{sprites.name}.#{Compass.configuration.preferred_syntax}")
|
47
44
|
options[:skip_overrides] ||= false
|
48
|
-
contents = sprites.content_for_images(
|
45
|
+
contents = sprites.content_for_images(options[:skip_overrides])
|
49
46
|
if options[:output_file][-4..-1] != "scss"
|
50
47
|
contents = Sass::Engine.new(contents, Compass.sass_engine_options.merge(:syntax => :scss)).to_tree.to_sass
|
51
48
|
end
|
data/lib/compass/compiler.rb
CHANGED
@@ -7,7 +7,7 @@ module Compass
|
|
7
7
|
|
8
8
|
def initialize(working_path, from, to, options)
|
9
9
|
self.working_path = working_path
|
10
|
-
self.from, self.to = from, to
|
10
|
+
self.from, self.to = from.gsub('./', ''), to
|
11
11
|
self.logger = options.delete(:logger)
|
12
12
|
self.options = options
|
13
13
|
self.options[:cache_location] ||= determine_cache_location
|
@@ -26,11 +26,15 @@ module Compass
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def relative_stylesheet_name(sass_file)
|
29
|
-
sass_file[(
|
29
|
+
sass_file[(from.length + 1)..-1]
|
30
30
|
end
|
31
31
|
|
32
32
|
def stylesheet_name(sass_file)
|
33
|
-
sass_file
|
33
|
+
if sass_file.index(from) == 0
|
34
|
+
sass_file[(from.length + 1)..-6]
|
35
|
+
else
|
36
|
+
raise Compass::Error, "You must compile individual stylesheets from the project directory."
|
37
|
+
end
|
34
38
|
end
|
35
39
|
|
36
40
|
def css_files
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Compass
|
2
2
|
module Configuration
|
3
|
+
@callbacks_loaded = false
|
3
4
|
# The helpers are available as methods on the Compass module. E.g. Compass.configuration
|
4
5
|
module Helpers
|
5
6
|
def configuration
|
@@ -65,14 +66,14 @@ module Compass
|
|
65
66
|
Sass::Plugin.add_template_location sass_dir, css_dir
|
66
67
|
end
|
67
68
|
end
|
68
|
-
unless
|
69
|
+
unless @callbacks_loaded
|
69
70
|
Sass::Plugin.on_updating_stylesheet do |sass_file, css_file|
|
70
71
|
Compass.configuration.run_callback(:stylesheet_saved, css_file)
|
71
72
|
end
|
72
73
|
Sass::Plugin.on_compilation_error do |e, filename, css|
|
73
74
|
Compass.configuration.run_callback(:stylesheet_error, filename, e.message)
|
74
75
|
end
|
75
|
-
|
76
|
+
@callbacks_loaded = true
|
76
77
|
end
|
77
78
|
end
|
78
79
|
|
@@ -1,5 +1,12 @@
|
|
1
1
|
module Compass::SassExtensions::Functions::Constants
|
2
2
|
if defined?(Sass::Script::List)
|
3
|
+
POSITIONS = /top|bottom|left|right|center/
|
4
|
+
def is_position(position)
|
5
|
+
Sass::Script::Bool.new(position.is_a?(Sass::Script::String) && !!(position.value =~ POSITIONS))
|
6
|
+
end
|
7
|
+
def is_position_list(position_list)
|
8
|
+
Sass::Script::Bool.new(position_list.is_a?(Sass::Script::List) && position_list.value.all?{|p| is_position(p).to_bool})
|
9
|
+
end
|
3
10
|
# returns the opposite position of a side or corner.
|
4
11
|
def opposite_position(position)
|
5
12
|
position = unless position.is_a?(Sass::Script::List)
|
@@ -1,4 +1,31 @@
|
|
1
1
|
module Compass::SassExtensions::Functions::CrossBrowserSupport
|
2
|
+
|
3
|
+
class CSS2FallbackValue < Sass::Script::Literal
|
4
|
+
attr_accessor :value, :css2_value
|
5
|
+
def children
|
6
|
+
[value, css2_value]
|
7
|
+
end
|
8
|
+
def initialize(value, css2_value)
|
9
|
+
self.value = value
|
10
|
+
self.css2_value = css2_value
|
11
|
+
end
|
12
|
+
def inspect
|
13
|
+
to_s
|
14
|
+
end
|
15
|
+
def to_s(options = self.options)
|
16
|
+
value.to_s(options)
|
17
|
+
end
|
18
|
+
def supports?(aspect)
|
19
|
+
aspect == "css2"
|
20
|
+
end
|
21
|
+
def has_aspect?
|
22
|
+
true
|
23
|
+
end
|
24
|
+
def to_css2(options = self.options)
|
25
|
+
css2_value
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
2
29
|
# Check if any of the arguments passed require a vendor prefix.
|
3
30
|
def prefixed(prefix, *args)
|
4
31
|
aspect = prefix.value.sub(/^-/,"")
|
@@ -36,4 +63,8 @@ module Compass::SassExtensions::Functions::CrossBrowserSupport
|
|
36
63
|
end
|
37
64
|
end
|
38
65
|
|
66
|
+
def css2_fallback(value, css2_value)
|
67
|
+
CSS2FallbackValue.new(value, css2_value)
|
68
|
+
end
|
69
|
+
|
39
70
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Compass::SassExtensions::Functions::GradientSupport
|
2
2
|
|
3
|
-
GRADIENT_ASPECTS = %w(webkit moz svg pie css2).freeze
|
3
|
+
GRADIENT_ASPECTS = %w(webkit moz svg pie css2 o).freeze
|
4
4
|
|
5
5
|
class ColorStop < Sass::Script::Literal
|
6
6
|
attr_accessor :color, :stop
|
@@ -34,15 +34,15 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
34
34
|
end
|
35
35
|
|
36
36
|
class RadialGradient < Sass::Script::Literal
|
37
|
-
attr_accessor :
|
37
|
+
attr_accessor :position_or_angle, :shape_and_size, :color_stops
|
38
38
|
def children
|
39
|
-
[color_stops,
|
39
|
+
[color_stops, position_or_angle, shape_and_size].compact
|
40
40
|
end
|
41
|
-
def initialize(
|
41
|
+
def initialize(position_or_angle, shape_and_size, color_stops)
|
42
42
|
unless color_stops.value.size >= 2
|
43
43
|
raise Sass::SyntaxError, "At least two color stops are required for a radial-gradient"
|
44
44
|
end
|
45
|
-
self.
|
45
|
+
self.position_or_angle = position_or_angle
|
46
46
|
self.shape_and_size = shape_and_size
|
47
47
|
self.color_stops = color_stops
|
48
48
|
end
|
@@ -51,22 +51,31 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
51
51
|
end
|
52
52
|
def to_s(options = self.options)
|
53
53
|
s = "radial-gradient("
|
54
|
-
s <<
|
54
|
+
s << position_or_angle.to_s(options) << ", " if position_or_angle
|
55
55
|
s << shape_and_size.to_s(options) << ", " if shape_and_size
|
56
56
|
s << color_stops.to_s(options)
|
57
57
|
s << ")"
|
58
58
|
end
|
59
59
|
def supports?(aspect)
|
60
|
-
|
60
|
+
if aspect == "svg"
|
61
|
+
if position_or_angle.nil? || is_position(position_or_angle).to_bool || is_position_list(position_or_angle).to_bool
|
62
|
+
true
|
63
|
+
else
|
64
|
+
Compass::Util.compass_warn("Warning: Angle-based gradients are not yet supported in SVG. Found: #{position_or_angle}")
|
65
|
+
false
|
66
|
+
end
|
67
|
+
else
|
68
|
+
GRADIENT_ASPECTS.include?(aspect)
|
69
|
+
end
|
61
70
|
end
|
62
71
|
def has_aspect?
|
63
72
|
true
|
64
73
|
end
|
65
74
|
def to_webkit(options = self.options)
|
66
75
|
args = [
|
67
|
-
grad_point(
|
76
|
+
grad_point(position_or_angle || _center_position),
|
68
77
|
Sass::Script::String.new("0"),
|
69
|
-
grad_point(
|
78
|
+
grad_point(position_or_angle || _center_position),
|
70
79
|
grad_end_position(color_stops, Sass::Script::Bool.new(true)),
|
71
80
|
grad_color_stops(color_stops)
|
72
81
|
]
|
@@ -77,9 +86,12 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
77
86
|
def to_moz(options = self.options)
|
78
87
|
Sass::Script::String.new("-moz-#{to_s(options)}")
|
79
88
|
end
|
89
|
+
def to_o(options = self.options)
|
90
|
+
Sass::Script::String.new("-o-#{to_s(options)}")
|
91
|
+
end
|
80
92
|
def to_svg(options = self.options)
|
81
93
|
# XXX Add shape support if possible
|
82
|
-
radial_svg_gradient(color_stops,
|
94
|
+
radial_svg_gradient(color_stops, position_or_angle || _center_position)
|
83
95
|
end
|
84
96
|
def to_pie(options = self.options)
|
85
97
|
Compass::Logger.new.record(:warning, "PIE does not support radial-gradient.")
|
@@ -91,15 +103,15 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
91
103
|
end
|
92
104
|
|
93
105
|
class LinearGradient < Sass::Script::Literal
|
94
|
-
attr_accessor :color_stops, :
|
106
|
+
attr_accessor :color_stops, :position_or_angle
|
95
107
|
def children
|
96
|
-
[color_stops,
|
108
|
+
[color_stops, position_or_angle].compact
|
97
109
|
end
|
98
|
-
def initialize(
|
110
|
+
def initialize(position_or_angle, color_stops)
|
99
111
|
unless color_stops.value.size >= 2
|
100
112
|
raise Sass::SyntaxError, "At least two color stops are required for a linear-gradient"
|
101
113
|
end
|
102
|
-
self.
|
114
|
+
self.position_or_angle = position_or_angle
|
103
115
|
self.color_stops = color_stops
|
104
116
|
end
|
105
117
|
def inspect
|
@@ -107,20 +119,29 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
107
119
|
end
|
108
120
|
def to_s(options = self.options)
|
109
121
|
s = "linear-gradient("
|
110
|
-
s <<
|
122
|
+
s << position_or_angle.to_s(options) << ", " if position_or_angle
|
111
123
|
s << color_stops.to_s(options)
|
112
124
|
s << ")"
|
113
125
|
end
|
114
126
|
def supports?(aspect)
|
115
|
-
|
127
|
+
if aspect == "svg"
|
128
|
+
if position_or_angle.nil? || is_position(position_or_angle).to_bool || is_position_list(position_or_angle).to_bool
|
129
|
+
true
|
130
|
+
else
|
131
|
+
Compass::Util.compass_warn("Warning: Angle-based gradients are not yet supported in SVG. Found: #{position_or_angle}")
|
132
|
+
false
|
133
|
+
end
|
134
|
+
else
|
135
|
+
GRADIENT_ASPECTS.include?(aspect)
|
136
|
+
end
|
116
137
|
end
|
117
138
|
def has_aspect?
|
118
139
|
true
|
119
140
|
end
|
120
141
|
def to_webkit(options = self.options)
|
121
142
|
args = []
|
122
|
-
args << grad_point(
|
123
|
-
args << grad_point(opposite_position(
|
143
|
+
args << grad_point(position_or_angle || Sass::Script::String.new("top"))
|
144
|
+
args << grad_point(opposite_position(position_or_angle || Sass::Script::String.new("top")))
|
124
145
|
args << grad_color_stops(color_stops)
|
125
146
|
args.each{|a| a.options = options}
|
126
147
|
Sass::Script::String.new("-webkit-gradient(linear, #{args.join(', ')})")
|
@@ -128,8 +149,11 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
128
149
|
def to_moz(options = self.options)
|
129
150
|
Sass::Script::String.new("-moz-#{to_s(options)}")
|
130
151
|
end
|
152
|
+
def to_o(options = self.options)
|
153
|
+
Sass::Script::String.new("-o-#{to_s(options)}")
|
154
|
+
end
|
131
155
|
def to_svg(options = self.options)
|
132
|
-
linear_svg_gradient(color_stops,
|
156
|
+
linear_svg_gradient(color_stops, position_or_angle || Sass::Script::String.new("top"))
|
133
157
|
end
|
134
158
|
def to_pie(options = self.options)
|
135
159
|
# PIE just uses the standard rep, but the property is prefixed so
|
@@ -144,13 +168,18 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
144
168
|
module Functions
|
145
169
|
|
146
170
|
# given a position list, return a corresponding position in percents
|
171
|
+
# otherwise, returns the original argument
|
147
172
|
def grad_point(position)
|
173
|
+
original_value = position
|
148
174
|
position = unless position.is_a?(Sass::Script::List)
|
149
175
|
Sass::Script::List.new([position], :space)
|
150
176
|
else
|
151
177
|
Sass::Script::List.new(position.value.dup, position.separator)
|
152
178
|
end
|
153
|
-
|
179
|
+
# Handle unknown arguments by passing them along untouched.
|
180
|
+
unless position.value.all?{|p| is_position(p).to_bool }
|
181
|
+
return original_value
|
182
|
+
end
|
154
183
|
if (position.value.first.value =~ /top|bottom/) or (position.value.last.value =~ /left|right/)
|
155
184
|
# browsers are pretty forgiving of reversed positions so we are too.
|
156
185
|
position.value.reverse!
|
@@ -192,7 +221,7 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
192
221
|
end, :comma)
|
193
222
|
end
|
194
223
|
|
195
|
-
def radial_gradient(
|
224
|
+
def radial_gradient(position_or_angle, shape_and_size, *color_stops)
|
196
225
|
# Have to deal with variable length/meaning arguments.
|
197
226
|
if color_stop?(shape_and_size)
|
198
227
|
color_stops.unshift(shape_and_size)
|
@@ -203,38 +232,38 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
203
232
|
shape_and_size = nil
|
204
233
|
end
|
205
234
|
shape_and_size = nil if shape_and_size && !shape_and_size.to_bool # nil out explictly passed falses
|
206
|
-
# ditto for
|
207
|
-
if color_stop?(
|
208
|
-
color_stops.unshift(
|
209
|
-
|
210
|
-
elsif list_of_color_stops?(
|
211
|
-
color_stops =
|
212
|
-
|
235
|
+
# ditto for position_or_angle
|
236
|
+
if color_stop?(position_or_angle)
|
237
|
+
color_stops.unshift(position_or_angle)
|
238
|
+
position_or_angle = nil
|
239
|
+
elsif list_of_color_stops?(position_or_angle)
|
240
|
+
color_stops = position_or_angle.value + color_stops
|
241
|
+
position_or_angle = nil
|
213
242
|
end
|
214
|
-
|
243
|
+
position_or_angle = nil if position_or_angle && !position_or_angle.to_bool
|
215
244
|
|
216
245
|
# Support legacy use of the color-stops() function
|
217
246
|
if color_stops.size == 1 && list_of_color_stops?(color_stops.first)
|
218
247
|
color_stops = color_stops.first.value
|
219
248
|
end
|
220
|
-
RadialGradient.new(
|
249
|
+
RadialGradient.new(position_or_angle, shape_and_size, send(:color_stops, *color_stops))
|
221
250
|
end
|
222
251
|
|
223
|
-
def linear_gradient(
|
224
|
-
if color_stop?(
|
225
|
-
color_stops.unshift(
|
226
|
-
|
227
|
-
elsif list_of_color_stops?(
|
228
|
-
color_stops =
|
229
|
-
|
252
|
+
def linear_gradient(position_or_angle, *color_stops)
|
253
|
+
if color_stop?(position_or_angle)
|
254
|
+
color_stops.unshift(position_or_angle)
|
255
|
+
position_or_angle = nil
|
256
|
+
elsif list_of_color_stops?(position_or_angle)
|
257
|
+
color_stops = position_or_angle.value + color_stops
|
258
|
+
position_or_angle = nil
|
230
259
|
end
|
231
|
-
|
260
|
+
position_or_angle = nil if position_or_angle && !position_or_angle.to_bool
|
232
261
|
|
233
262
|
# Support legacy use of the color-stops() function
|
234
|
-
if color_stops.size == 1 && list_of_color_stops?(color_stops.first)
|
235
|
-
color_stops =
|
263
|
+
if color_stops.size == 1 && (stops = list_of_color_stops?(color_stops.first))
|
264
|
+
color_stops = stops
|
236
265
|
end
|
237
|
-
LinearGradient.new(
|
266
|
+
LinearGradient.new(position_or_angle, send(:color_stops, *color_stops))
|
238
267
|
end
|
239
268
|
|
240
269
|
# returns color-stop() calls for use in webkit.
|
@@ -255,8 +284,8 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
255
284
|
stop = pos.stop
|
256
285
|
stop = stop.div(max).times(Sass::Script::Number.new(100,["%"])) if stop.numerator_units == max.numerator_units && max.numerator_units != ["%"]
|
257
286
|
# Make sure the color stops are specified in the right order.
|
258
|
-
if last_value && last_value.
|
259
|
-
raise Sass::SyntaxError.new("Color stops must be specified in increasing order")
|
287
|
+
if last_value && stop.numerator_units == last_value.numerator_units && stop.denominator_units == last_value.denominator_units && stop.value < last_value.value
|
288
|
+
raise Sass::SyntaxError.new("Color stops must be specified in increasing order. #{stop.value} came after #{last_value.value}.")
|
260
289
|
end
|
261
290
|
last_value = stop
|
262
291
|
[stop, pos.color]
|
@@ -386,7 +415,11 @@ module Compass::SassExtensions::Functions::GradientSupport
|
|
386
415
|
end
|
387
416
|
|
388
417
|
def list_of_color_stops?(arg)
|
389
|
-
arg.
|
418
|
+
if arg.respond_to?(:value)
|
419
|
+
arg.value.is_a?(Array) && arg.value.all?{|a| color_stop?(a)} ? arg.value : nil
|
420
|
+
elsif arg.is_a?(Array)
|
421
|
+
arg.all?{|a| color_stop?(a)} ? arg : nil
|
422
|
+
end
|
390
423
|
end
|
391
424
|
|
392
425
|
def linear_svg(color_stops, x1, y1, x2, y2)
|