Javafx css achieve this sort of effect on text - css

I am trying to style some text in my Javafx application by making use of css. The effect I am trying to achieve is something like this:
I have the font, but it is just the effect that I am missing. This is what my .css file contains for the text.
.progress-view .title {
-fx-font-family: "Bilbo Swash Caps";
-fx-font-size: 34px;
-fx-text-fill: white;
-fx-blend-mode: darken;
-fx-opacity: 0.8;
-fx-effect: innershadow(gaussian , rgba(0,0,0,0.2),6,0.0,0,2);
}
The effect I have does not look remotely close to this. Also is this achievable by manipulating the effect or something else?
Thanks

Using the following I seem to have gotten the text to look like the second one (bottom) which is good enough for me:
.progress-view .title {
-fx-font: 60px "Bilbo Swash Caps";
-fx-fill: white;
-fx-stroke: black;
-fx-stroke-width: 2;
-fx-blend-mode: darken;
}
Would like to see that smokey effect of the other one though, so post any solutions you found. Thanks!

Related

how to customize the look of a Tab for Android in codename one?

I am using the CSS Plugin for codename one and I am trying to customize the look of Tabs.
Here is my entry for the Tab:
Tab {
background: none;
cn1-background-type: none;
color: white;
background-color: #005EA8;
font-weight: bold;
font-size: x-large;
}
Tab.selected {
background: none;
cn1-background-type: none;
color: white;
background-color: #005EA8;
text-decoration: underline;
font-weight: bold;
font-size: x-large;
}
This works perfectly for IOS, see here:
But not at all for android:
I have already tried by overriding all the styles, unselected, selected, disabled and pressed
.
I also tried by customizing TabbedPane and Tabs, but that did not work as expected either.
What am I missing here? Additionally, the size (height) should be the same on both devices, which is not the case for now. Another point I could not figure out is, how to stretch the tabs onto screen size?
The Android native theme defines a default background color of #f0f0f0 on ALL styles. This is an annoyance when you are trying to create themes that look the same across all platforms. Luckily, I think this is the only style that it defines in default so you can easily combat it by explicitly setting your own default background color for your theme.
In CSS, you can define a default background with
* {
background-color: transparent;
}
Alternatively, just keep this default in mind, and explicitly set the background color for any style you are defining.
You need to override the border and declare it to be "empty". I'm not sure how something like that is done in the CSS syntax as I don't use that myself.

Highlight text only, with opacity to the background

I have some text in my header which can be hard to see on different viewports. So, I want to highlight it as if you select it on a website (but black with opacity instead of the default blue).
I currently styled my header text like this:
header .header-content .header-content-inner h1 {
margin-top: 0;
margin-bottom: 0;
text-transform: uppercase;
font-weight: 700;
(site: topsok [dot] nl).
I tried some different things with <mark> and background: in my stylesheet, but I wasn't able to add opacity to the selection. I would like it to look exactly the same way it looks now when you manually select the text on the header.
Any help would be appreciated! Thanks.
Something like this?
h1 {
background: rgba(0,0,0,0.8);
display: initial;
}

JavaFX: Change text color of textarea

Alright so I can't get this to work at all. I've checked the CSS analyzer in the scene builder and I came to the conclusion that the way to change the text color in a textarea is something similar to this:`
.text-area .text {
-fx-fill: #1e88e5;
-fx-font-size: 32px;
}`
Problem is that the color doesn't change nor does the font size. Where am I going wrong here?
How about this:
.text-area {
-fx-text-fill: #1e88e5;
-fx-font-size: 32px;
}
Update: the Style class text-area doesn't have a descendant named text. it has an immediate child named scroll-pane and a decendant named content .for more information see: this link

CSS - Change the color names

In CSS have a way to change the color of color names?
Example:
background: white;
I want to change the color of the "white"... there's a way for this?
Try using a CSS preprocessor such as: SASS to add functionality to CSS see http://sass-lang.com/guide
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
}
There is no way to achieve this in CSS, or at least none that I know of.
However, you may want to take a look at CSS preprocessors, such as LESS or SASS. Regardless of which one you choose, you gain the ability of declaring your own variables, e.g.
#white: rgb(250, 250, 250);
body {
background-color: #white;
}

GWT button background not working

I am new to GWT/uiBinder (latest version of GWT and testing under latest Eclipse) and really puzzled. My CSS for buttons is ...
/* --button-- */
.gwt-Button {
font-size: 16px;
font-weight: normal;
color: #0F0;
background: #F00; /* this gets ignored */
}
The background does nothing, the rest works.
I have tested that this CSS entry does something by changing the color and seeing that it works. I have also tried "background-color" (I have seen both in various docs). The background never changes.
I also tested a gwt-TextBox as follows and it works just fine.
/* --text box-- */
.gwt-TextBox {
font-size: 16px;
font-weight: normal;
color: #0F0;
background: Beige;
}
Note: I know that sometimes while testing you have to refresh the web page to see your changes.
Note: I can set the button background by using a CSS entry called "myButton" and using styleName='myButton' it in the uiBinder entry.
Note: The button is in a Layer in a LayoutPanel in a north:DockLayoutPanel in an east:DockLayoutPanel.
Help!
https://stackoverflow.com/a/7833358/635411
You can use a more specific selector like the other answer suggests:
/* --button-- */
button.gwt-Button {
font-size: 16px;
font-weight: normal;
color: #0F0;
background: #F00;
}
Personally, I try to avoid overwriting the default styles because of the precedence issues.
I think this should solve your problem
.gwt-Button {
font-size: 16px;
font-weight: normal;
color: #0F0;
background: #F00 !important;
}
You need to include this line before you make any changes to the background of gwt-Button
background-image:initial !important;
The problem you're having is that you're trying to set a background color, when gwt-Button uses a background image, so the image goes over your background color, making it seem like your css is being ignored.
there is a simpler way
you need to remove the gwt-Button style and then add whatever color you like
`
Button button=new Button();
button.removeStyleName("gwt-Button");
button.getElement().getStyle().setbackgroundColor("#F00");
//incase you need to remove the default border style aswell
button.getElement().getStyle().setBorderStyle(BorderStyle.NONE);
`

Resources