How to delete border in combox javafx - javafx

How to delete this borders in top, right and down sides;

I find decision by myself.
.combo-box .scroll-bar:vertical {
-fx-background-color: transparent;
-fx-border-color: transparent;
}
.combo-box .scroll-bar:vertical .track {
visibility: hidden;
-fx-background-color: transparent;
-fx-border-color: transparent;
}

Related

Is there a pseudo element for the scrollbar buttons when the scrollbar reaches the content end?

Im trying to figure out if it is possible to select the arrows when you cannot scroll any further in the designated direction. Has anyone come across a pseudo selector for this case ?
Here's an idea:
You can check if the user has scrolled down to the bottom via jquery.
I have inserted some css code about the scrollbar manipulation. Now you just have to combine them. Good luck!
Scrollbar customizations are not fully supported on Firefox and some other browsers
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
alert("bottom!");
}
});
.container {
display: block;
height: 800px;
}
::-webkit-scrollbar {
width: 16px;
border: 5px solid white;
}
::-webkit-scrollbar-thumb {
background-color: #b0b0b0;
background-clip: padding-box;
border: 0.05em solid #eeeeee;
}
::-webkit-scrollbar-track {
background-color: #bbbbbb;
}
/* Buttons */
::-webkit-scrollbar-button:single-button {
background-color: #bbbbbb;
display: block;
border-style: solid;
height: 13px;
width: 16px;
}
/* Up */
::-webkit-scrollbar-button:single-button:vertical:decrement {
border-width: 0 8px 8px 8px;
border-color: transparent transparent #555555 transparent;
}
::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
border-color: transparent transparent #777777 transparent;
}
/* Down */
::-webkit-scrollbar-button:single-button:vertical:increment {
border-width: 8px 8px 0 8px;
border-color: #555555 transparent transparent transparent;
}
::-webkit-scrollbar-button:vertical:single-button:increment:hover {
border-color: #777777 transparent transparent transparent;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="container"></div>

How to change background-color of input when selected

I can't change the background-color of the input when an option is selected. When it's not is transparent.
this is when options appear in my input with transparent background
when i choose an option from before
It looks like a cyan type of color.
input {
width: 300px;
height: 30px;
outline: none;
border: none;
border-bottom: 1px solid #fff;
background-color: transparent;
background: transparent;
color: #fff;
font-size: 20px;
font-weight: lighter;
}
input:required:focus {
background-color: transparent;
}
input::placeholder {
background-color: transparent;
}
input:focus {
background-color: transparent;
}
What I've been trying so far
input:focus
{
background-color:yellow
}

Fill a corner of the selected ComboBox cell with the main color JavaFX, CSS

Is it possible to fill corner of the selected ComboBox cell with the main color (It remains white instead of #2f4f4f).
Here is my CSS code:
.combo-box {
-fx-border-color: #000000;
-fx-border-width: 1;
-fx-background-radius: 0;
-fx-background-color: #2f4f4f;
-fx-font-family: "Arial";
-fx-font-size: 12px;
-fx-text-fill: #ffffff;
-fx-background-insets: 0;
-fx-alignment: center;
-fx-content-display: center;
}
.combo-box > .cell {
-fx-text-fill: #ffffff;
-fx-alignment: center;
}
.combo-box:hover {
-fx-background-color: #87cefa;
}
.combo-box-popup .list-view .list-cell {
-fx-background-color: #2f4f4f;
-fx-text-fill: #ffffff;
-fx-text-alignment: center;
}
.combo-box-popup .list-view .list-cell:filled:selected,
.combo-box-popup .list-view .list-cell:filled:selected:hover {
-fx-background: #2f4f4f;
-fx-background-color: #87cefa;
-fx-text-fill: #ffffff;
-fx-text-alignment: center;
}
.combo-box-popup .list-view .list-cell:filled:hover {
-fx-background-color: #87cefa;
-fx-text-alignment: center;
-fx-background-radius: 10.0;
}
enter image description here
add this to your CSS style:
.combo-box-popup .list-view {
-fx-background-color: #2f4f4f;
}

How to set opacity for the border with CurrentColor?

I customize the link. I want the border-color to depend on the color. For this I use CurrentColor.
How to make border-bottom with opacity 0.5?
a {
text-decoration: none;
color: blue;
border-bottom: 1px solid CurrentColor;
}
Some link
I have one solution, but I'm not sure that it is the best.
a {
text-decoration: none;
color: blue;
background: linear-gradient(to bottom, CurrentColor, transparent 50%) 0 100% repeat-x;
background-size: 10px 1px;
}
Some link
This solution doesn’t work.
a {
--color: blue;
text-decoration: none;
color: var(blue);
border-bottom: 1px solid rgba(var(--color), 0.5);
}
Some link
With CSS variables you need to do something like this:
a {
--color: 0,0,255;
text-decoration: none;
color: rgb(var(--color));
border-bottom: 1px solid rgba(var(--color), 0.2);
}
Some link
For the gradient solution you may create two gradients. A bottom one with the currentColor and a top one with the background color (white in this case) and adjust the opacity of the top one to control the opacity of the bottom one:
a {
text-decoration: none;
color: blue;
background-image:
linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0.8)),
linear-gradient(CurrentColor, CurrentColor);
background-position:bottom;
background-size:100% 1px;
background-repeat:no-repeat;
}
Some link
You can also use pseudo-element and opacity:
a {
text-decoration: none;
color: blue;
position:relative;
}
a:after {
content:"";
position:absolute;
bottom:0;
right:0;
left:0;
height:1px;
background:currentColor;
opacity:0.2;
}
Some link
Another idea is to use box-shadow like we did with gradient by having two layers:
a {
text-decoration: none;
color: blue;
box-shadow:
0 1px 0 0 rgba(255,255,255,0.8),
0 1px 0 0 currentColor;
}
Some link
It because you set --color: blue and it not rgb color you have to set rgb color.. the a of rgba is the opacity
a {
--color: 1,1,1;
text-decoration: none;
color: var(--color);
border-bottom: 1px solid rgba(var(--color), 0.2);
}
Some link
You can convert color to rgb here:https://www.rapidtables.com/convert/color/hex-to-rgb.html

How do I select for a -webkit-scrollbar-button once the track has reached the limit in that direction?

I want to set the css of scrollbar buttons once the scrollbar thumb has reached the end in that direction. That is, I want to select the :decrement button when the scroll thumb cannot be decremented any more. The default scroll bar grays out buttons when they're in contact with the thumb. I thought the :disabled selector would do what I want, but no such luck.
::-webkit-scrollbar-track {
background-color: #bbbbbb;
}
/* Buttons */
::-webkit-scrollbar-button:single-button {
background-color: #bbbbbb;
display: block;
border-style: solid;
height: 13px;
width: 16px;
}
/* Up */
::-webkit-scrollbar-button:single-button:vertical:decrement {
border-width: 0 8px 8px 8px;
border-color: transparent transparent #555555 transparent;
}
::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
border-color: transparent transparent #777777 transparent;
}
/* Down */
::-webkit-scrollbar-button:single-button:vertical:increment {
border-width: 8px 8px 0 8px;
border-color: #555555 transparent transparent transparent;
}
::-webkit-scrollbar-button:vertical:single-button:increment:hover {
border-color: #777777 transparent transparent transparent;
}

Resources