JavaFX: Style undecorated Window with InnerShadow but without top - css

I created an undecorated window with own title etc. For this one I added a style:
.pane-basicwindow{
-fx-border-color: gray;
-fx-border-style: solid;
-fx-border-width: 1;
-fx-effect: innershadow(three-pass-box, rgba(100, 100, 100, 1), 10, 0, 0, 0);}
With the help of this I created an innershadow. But I want to have the innershadow just on left, right and bottom side. Consequently the top side should be without shadow. I know that if I change the last value of the innershadow, I can move the position of the shadow upwards. For example like this
-fx-effect: innershadow(three-pass-box, rgba(100, 100, 100, 1), 10, 0, 0, -4);
But in this case the shadow on bottom side also moves upwards so that this one is bigger than the one one right/left side.
So my question is: What have to be done so that the shadows on left, right and bottom side have the same size while the innershadow on top is invisible?
I checked a lot of other questions here but couldn't find an answer for my case. I also played a little bit with outsets but couldn't find a result, too. Does anybody has an idea?

You can "simply" rebuild the shadow and just add it to the borders you like, something like this:
.pane-basicwindow {
-fx-border-color:
linear-gradient(to right, rgba(0, 0, 0, 0.2), transparent),
linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent),
linear-gradient(to left, rgba(0, 0, 0, 0.2), transparent);
-fx-border-style: solid;
-fx-border-width:
0 0 0 0.417em,
0 0 0.417em 0,
0 0.417em 0 0;
}

Related

CSS Gradients with multiple angles

I need to create a gradient from left to right with three vertical colors and another gradient on an angle. Apologies for the poor image below. The black line would represent the angle gradient (if you could imagine it fading into black).
I have tried numerous ways, However, I seem to not be able to do this.
I would require this in CSS. Any help would be much appreciate, any further information required please ask.
Thanks for your time.
Roddest.
Something like this, you can adjust the values as you want:
background: linear-gradient(45deg, rgba(0, 0, 0, 255), rgba(0, 0, 0, 0), rgba(0, 0, 0, 255)) no-repeat border-box, linear-gradient(to right, #0ff 10%, #f00 50%, #0ff 90%) no-repeat border-box;
There are two gradients, one black and transparent in the middle and from top right to bottom left, and a second from left to right, cyan, red and cyan.

Transparency in the ends of a border right in CSS

I have to create a border-right on td tag which is transparent only in the ends i.e the border must be of the width 1px in the center and keep decreasing till the end. How can I achieve this?
This might what you're looking for
border-image: linear-gradient(to right, black, rgba(0, 0, 0, 0)) 1 100%;

Firefox multiple gradient backgrounds bug

My goal is to give some divs a top and left inner shadow. To do that, I have given the divs two background-images with linear-gradient:
background-image: linear-gradient(90deg, #263B4B 0, transparent 50px),
linear-gradient(180deg, #263B4B 0, transparent 50px);
This looks fine in Chrome 39 and IE 11, but not in Firefox 32.
Firefox doesn't display it correctly.
At first, I had the following CSS, which worked fine, but since there are many divs with this shadow, the page rendering was extremly slow to unusable, especially on mobile. So I don't want to use box-shadow.
box-shadow: 18px 31px 95px 0px rgba(0, 0, 0, .2) inset;
How do I get this to work on Firefox without using an image file?
JSFiddle: http://jsfiddle.net/eLkhwoqg/2
Firefox's interpolation between other color stops and the transparent keyword isn't quite right. Because transparent corresponds to rgba(0, 0, 0, 0), Firefox is using that value to calculate the gradient, except it is doing so in non-premultiplied RGBA space, which results in the gradient transitioning from your given color to black. We know this behavior is in fact incorrect, because the spec says so.
Fortunately, the workaround is easy: simply use a zero alpha version of the same color you're using and Firefox will interpolate the gradient correctly:
background-image: linear-gradient(90deg, #263B4B 0, rgba(38, 59, 75, 0) 50px),
linear-gradient(180deg, #263B4B 0, rgba(38, 59, 75, 0) 50px);
Once this is fixed, you will be able to use the transparent keyword going forward.

JavaFx ONLY TOP innerShadow

I'm playing with inner shadow fx effect. I'm trying to get shadow appearing only on top of VBox. Can anybody give me a hint
-fx-effect: innershadow(gaussian, #787878, 10, 0, 0,2 );
I had a problem similiar to yours. I wanted to add a shadow on every edges without the top. Look into my post: JavaFX: Style undecorated Window with InnerShadow but without top
There you can find the solution given by Kalaschni: You can rebuild your shadow and add it to the border. In your case it looks like:
-fx-border-color:
linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent);
-fx-border-style: solid;
-fx-border-width:
5px 0 0 0;
Instead of px you may use em, too (-fx-border-width: 0.417em 0 0 0;).

Dropshadow on Bootstrap navbar

I have been trying to add a drop-shadow to the top floating navbar in Twitter Bootstrap
Here's my site:
http://www.japaneselanguagefriend.com/application/home.php
I believe this is the correct area in the bootstrap.min.css to target the drop shadow?
.navbar-inner
.navbar-inner{min-height:45px;padding-left:25px;padding-right:25px;background-color:#fafafa;background-image:-moz-linear-gradient(top,
#f89406, #fbb450);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f89406),
to(#fbb450));background-image:-webkit-linear-gradient(top, #f89406,
#fbb450);background-image:-o-linear-gradient(top, #ffffff, #f2f2f2);background-image:linear-gradient(to bottom, #f89406, #fbb450);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',
endColorstr='#fff2f2f2', GradientType=0);border:1px solid
#d4d4d4;-webkit-border-radius:155px;-moz-border-radius:155px;border-radius:155px;-webkit-box-shadow:155
155px 155px rgba(345, 5, 5, 5);-moz-box-shadow:515 155px 155px
rgba(345, 0, 0, 5);box-shadow:155 155px 45px rgba(0, 0, 0,
5);*zoom:1;}.navbar-inner:before,.navbar-inner:after{display:table;content:"";line-height:5;}
I then preceded to adjust the mox-box-shadow and webkit-box-shadow numbers accordingly. I still didn't see a change. So then I raised the numbers really high, above the 100s just to see if anything is actually changing, and still no effect or drop shadow, can anyone tell me what I am doing wrong? thanks!

Resources