I have created a Menu on my JavaFX application. Here i want to style the RadioMenuItem component:
How i can:
Modify the Arrow to colorize the Background (Like )
Hide only the Arrow completely
// [...]
You can use CSS styles.
Background color (checked):
.radio-menu-item:checked > .left-container {
-fx-background-color: blue;
}
Arrow color:
.radio-menu-item:checked > .left-container > .radio {
-fx-background-color: blue;
}
Same color hides the arrow.
Related
I am trying to change the color of the Wordpress Download Manager (WPDownloadManager) plugin's link-template-button.
It doesn't seem to have it's own color style for the colored button, which is problematic, since it uses the primary link color of the rest of the site.
The primary link color of the site has a red-ish color, while my download button is blue.
I want the download-button text to be white (to achieve white on blue) instead of the current red on blue.
These are the css-classes used by the button: wpdm-download-link wpdm-download-locked btn btn-primary
I tried to add CSS additions as follows (none of which are working):
.wpdm-download-link.wpdm-download-locked.btn.btn-primary a:link {
color: #ffffff;
}
.wpdm-download-link a:link {
color: #ffffff;
}
a.wpdm-download-link:link {
color: #ffffff;
}
...and other combinations of of these classes.
I also tried for a:visited, a:hoover etc.
I found that the set primary link color you select on the Customize > Colours > Primary Link Color uses a #content attribute, so in order to change the color for all WPDownloadManager, you need to add Additional CSS like so:
#content a.wpdm-download-link {
color: #ffffff;
}
or if you want different colors/styles e.g for link and hover:
#content a.wpdm-download-link:link {
color: #ffffff;
}
#content a.wpdm-download-link:hover {
color: #aaffaa;
}
In a CSS style-sheet in JavaFX can I add a style class that allows the color of the text to be changed when the mouse actually hovers on the text itself instead of just the list-view cell?
This seems to work:
.list-cell .text {
/* Default value: */
-fx-fill: -fx-text-background-color ;
}
.list-cell .text:hover {
-fx-fill: yellow ;
}
Note the .text style class does not seem to be documented.
I have some simple html/css with font awesome fonts to customise a checkbox. I am struggling to modify the colour (to red for now) when the checkbox is hovered.
As I am using a font awesome font to customise the checkbox, I assumed I needed to apply the css on hover of the label but its not having the desired effect.
input.faChkRnd:hover + label:before {
color: red;
}
This seems to change only on click of the checkbox and not when hovering.
any help appreciated!
fiddle here
You can't hover the input as it is display: none. Add your :hover to the label:
input.faChkRnd + label:hover:before {
color: red;
}
Updated fiddle
we cannot target hover state on an element which has display:none property. we can have a hover on label.
//when input is not checked
input.faChkRnd + label:hover:before {
color: red;
}
//when input is checked
input.faChkRnd:checked + label:hover:before {
color: green;
}
https://jsfiddle.net/a0s0gkxb/3/
This library might help to customise checkboxes and radio buttons , https://lokesh-coder.github.io/pretty-checkbox/
i have a issue with menu that i cant change text color in mini fixed meni in this site
I tryed to add this CSS to custom CSS:
.classic-menu .menu-item a {
color: #000;
}
but when set color to #000 then color in main menu is turn black. So i want color in main menu to be white in black background, and in mini fixed menu when scroll down, to be white background with black font color. How to do this?
Thanks.
Do this in your CSS:
.classic-menu .menu-item a {
color: #fff;
}
.mini .menu-item a {
color: #000;
}
.classic-menu is basically the regular state of your menu (when the background is black)
.mini-active is basically when the mini menu is activated, this way you'll get black for the mini menu and white for the regular one.
Hope that helps!
Try this
write this code for your main menu, I think this is your main menu class
.classic-menu .menu-item a
{
background-color:#000;
color:#fff;
}
write this code for your sticky menu or scroll menu class, i don't know your scroll menu class
{
background-color:#fff;
color:#000;
}
to override this class use !important
Code to change color
c.getStyleClass().add("required");
and in css
.required {
-fx-control-inner-background: red;
}
But context menu on that textField will have the same color.
How to solve it?
The rule
.required {
-fx-control-inner-background: red;
}
sets -fx-control-inner-background for the selected element and it's decendants.
Therefore you have to change it back to the default value for decendants of the selected node where the effect is not desired. Since the context menu is treated as decendant, you need to change it for the context menu, e.g. by adding this rule to the css:
.required .context-menu {
-fx-control-inner-background: derive(-fx-base,80%);
}