Hello Fellow StackOverflow Users, this is my first post/question and hopefully i'm not violating any rules/ect.
Unfortunately I am unable to post a picture, but I will put this here for a reference.
http://i.imgur.com/M0uckkg.jpg (Before Button Click)
OT: On the picture above, I am attempting to make the button's background completely transparent besides the text.
http://i.imgur.com/bFOEOVC.jpg (After Button Click)
Everything works out until I click the button then shadows appear on the side.
Here is what I have tried…
CSS
.toggle-button {
-fx-text-fill: black;
-fx-base: transparent;
-fx-background: transparent;
-fx-focus-color: transparent;
-fx-border-color: transparent;
-fx-effect: null;
}
.toggle-button:selected {
-fx-text-fill: black;
-fx-base: transparent;
-fx-background: transparent;
-fx-focus-color: transparent;
-fx-border-color: transparent;
-fx-effect: null;
}
The java code is just a plain simple application with a ToggleButton.
Special Thanks in Advance!
– Bart
Best Solution
I wouldn't recommend modifing the main color palette (
-fx-base
and others) for just one control. This makes sense if you're trying to style all of them.Looking at how is defined in
modena.css
:you will need to change all of them:
-fx-shadow-highlight-color
,-fx-outer-border
,...Instead, I'll just override the style of the toggle button with your requirements:
NOTE I've edited my answer since, as @eckig suggests, it's redundant to apply the same color to the different comma separated values.