-
-
Notifications
You must be signed in to change notification settings - Fork 879
linear-gradient cannot include transparent
#498
Comments
@pathawks - is this for layered gradients? If its not - try using @include linear-gradient(rgb(255,255,255) 0px, rgba(255,255,255,0) 100px); |
Added a PR for forcing better transparency for layered gradients w/ an optional variable |
@pathawks You can also set the fallback color to @include linear-gradient(white 0px, transparent 100px, $fallback: transparent); |
Ran into same problem. Had a black transparent gradient (opacity 80% to 60%) and wanted a fallback color with, say, 60% transparency (or flat color). This would work if instead of explicitly setting |
I agree that this is unexpected behavior, but in the meantime you can avoid the $fallback variable by specifying values backwards and using a directional keyword. This lets "transparent" becomes the fallback by virtue of being the first value given:
|
Don’s comment above should resolve this original issue of fading from @include linear-gradient(white 0px, transparent 100px, $fallback: transparent); Here’s a CodePen: http://codepen.io/tysongach/pen/bdEwvV It’s also worth noting that unless you need IE9 support, vendor prefixing is no longer needed, and you can go with regular ’ol CSS: background: linear-gradient(180deg, white, transparent); |
I am trying to fade from white to transparent, but because bourbon sets the background color to white, the whole background is white.
This produces the following CSS:
The fallback
background-color
prevents any part of the background from being transparent.bourbon does check to see if the fallback color is transparent, but it only checks the first color step.
The text was updated successfully, but these errors were encountered: