css - Is it possible to fade a horizontal gradient into a vertical gradient to MASK something -
i have 3 background gradients, horizontal mask, top border , bottom border achieves effect, fading borders background:
using code (repeated browser prefixes million times.. ugh):
background: linear-gradient(to right, rgba(200,100,40,1) 0%,rgba(250,235,115,0.5) 50%,rgba(200,100,40,1) 100%), linear-gradient(to top, rgba(240,175,30,1) 0%,rgba(240,175,30,0) 2px), linear-gradient(to bottom, rgba(250,235,115,1) 0%,rgba(250,235,115,0) 2px) ; /* w3c */
it's there problem edges of mask full opacity (1) background isn't solid colour (some horizontal grds & inner shadow), resulting in these problems.
my solution @ moment modify background code ensure background doesn't start fading until it's past top mask , bottom background colour full before bottom mask. cumbersome , inflexible, not css3 about.
i have seen solutions fading out borders ("fade" borders in css) should work setting border colour gradient i'm yet see work , threads dated.
here without "mask":
edit: solution: http://jsfiddle.net/turnosaurus/swvjj/
found few things, got solution:
-webkit-mask-image: -webkit-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
however, removes drop shadow effect i'm applying element using pseudo :after , won't perform across browsers. running out of time fiddle though..
http://www.html5rocks.com/en/tutorials/masking/adobe/
http://thenittygritty.co/css-masking
https://developer.mozilla.org/en-us/docs/applying_svg_effects_to_html_content
http://mir.aculo.us/2012/09/16/masking-html-elements-with-gradient-based-fadeouts/
Comments
Post a Comment