nib icon indicating copy to clipboard operation
nib copied to clipboard

iteration variable `i` leaked into background image url.

Open asuth opened this issue 12 years ago • 4 comments

When I use a file path that includes /i/, nib replaces that /i/ with /0/ in the vendor-prefixed gradients.

a
    background-image url(/i/providence/plus.png) linear-gradient(top, rgba(0,0,0,0.25), rgba(0,0,0,0.07))

produces

a {
  background-image: url("/0/providence/plus.png") -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(0,0,0,0.25)), color-stop(1, rgba(0,0,0,0.07)));
  background-image: url("/0/providence/plus.png") -webkit-linear-gradient(top, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.07) 100%);
  background-image: url("/0/providence/plus.png") -moz-linear-gradient(top, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.07) 100%);
  background-image: url("/i/providence/plus.png") linear-gradient(top, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.07) 100%);
}

asuth avatar Feb 29 '12 18:02 asuth

There are two workarounds for this:

  1. Enclose the url in quotes, like url('/i/providence/plus.png').
  2. Escape the i, like url(/\i/providence/plus.png).

In those cases the i won't be replaced.

kizu avatar Apr 14 '12 13:04 kizu

hm, fair enough, but should be fixed!

asuth avatar Apr 16 '12 04:04 asuth

Just met this bug. I enclosed the URL in quotes to avoid it, but I would prefer to use the simpler and valid CSS syntax with no quotes.

tregagnon avatar Aug 29 '12 12:08 tregagnon

blah yeah that is no good, we need to get on mandatory $ var prefixes. CSS url() syntax is a disaster, why they didn't force quotes is beyond me but it's extremely lame

tj avatar Aug 29 '12 21:08 tj