I'm using RichTextFx (CodeArea) to highlight my code. I want to change text background color for some keywords and use css below:
.parameter {
-rtfx-background-color: yellow;
}
But it's changes background color for all text between my keywords (:p1 and :p2 in this example). Font color and style change successfully.
use StyleClassedTextArea.setStyleClass(from, to, "class Name"); to add class name to some specific range.
Related
The links within the body change color once you hover and click on the link. Is there a way to have the color fix within the body of the mkdocs. I've been using some mkdocs documentation as an example, but so far I have this
css: `
body {
font-family: ${theme.typography.fontFamily};
--md-text-color: ${theme.palette.text.primary};
--md-text-link-color: #8CD7F7;
--md-code-fg-color: ${theme.palette.text.primary};
--md-code-bg-color: ${theme.palette.background.paper};
}
I would like the links to be the same when the user hovers and clicks on it. Whats the correct syntax for when the link is pressed or hovered over.
I've tried adding
.md-nav__link:hover { color: #8CD7F7; }
.md-nav__link--active { color: #8CD7F7; }
within the body, but that's not helping. I wonder if there's different syntax thats supposed to followed when inside the body
In my project I use, for example, two colors.
I created a folder in root called "stylesheets", where I created the extra.css file. That's what's inside of this file:
:root {
--md-primary-fg-color: #5f64a0;
--md-accent-fg-color: #5f64a0;
}
The first primary color is responsible for the upper bar (please, correct if I am using a wrong term) with the search to change the color.
The second accent color changes the color of the link if you hover. It won't change the color when the link is clicked.
If you keep the primary and accent colors the same, you will have the same color for links if you hover and the upper bar. If you comment the primary color, the upper bar will be purple by default and the links will be the accent color.
Also, if you specify primary and accent colors, you will get the same color when the link is clicked.
Don't forget to configure your mkdocs.yml:
extra_css:
- stylesheets/extra.css
theme:
palette:
primary: stylesheets/extra.css
name: material
logo: 'images/logo.png'
What is the correct way to assign default values to all text on the website using Tailwind CSS?
Is there a setting in tailwind.config.js for that?
You cannot directly do that in tailwind, meanwhile you can set the text to use a specific color globally with something like
* {
#apply text-blue-500; // can also customize it to have a `text-primary-500`
}
And customize the blue color values to your liking: https://tailwindcss.com/docs/customizing-colors#curating-colors
When I create a CSS provider with gtk_css_provider_new, and load it with gtk_css_provider_load_from_data, giving it "textview { color: red; font: 30px serif; }" as the data, and apply it to a gtk_text_view by using gtk_style_context_add_provider, the result is that it changes the font size to 30, but leaves the text color as black. What do I have to do the change the text color?
That it changes the font size shows that the CSS is actually working. That it doesn't change the color shows that it's only partly working. Is there something special that has to be done to change text color? Something different than what changes the font size?
If I use gdk_rgba_to_string to show the rgba, it shows it as "rgb(255,0,0)" which shows that the style context actually has the color red. So the only issue is why the red isn't used as the actual text color when the 30px serif is used as the actual font.
To change the color of the text you have to select the text part of the TextView in CSS... it would be something like this
textview text {
color : #4fc3f7;
}
This would change the text color to blue.You could always use the Gtk inspector to identify the css nodes associated with the window(Ctrl + Shift + I or D ) if you want to modify more..
Another way to do this is to use (gtk_text_buffer_create_tag https://developer.gnome.org/gtk3/stable/GtkTextView.html) and add the text using (gtk_text_buffer_insert_with_tags_by_name)
I start from this default theme (blucristal)
https://openui5.hana.ondemand.com/explored.html#/sample/sap.m.sample.InputAssisted/preview
Now I want change the background of the editable input from white to (for example) yellow. How Can I do?
I would like use Ui theme designer but I can't find the correct property to change
Any visual customization of standard controls can be done with help of CSS.
Redefine property of standard class
.sapMInputBaseInner{
background-color: yellow !important;
};
It will change background color for every intup. Or you can create your own CSS class
.UserClass .sapMInputBaseInner{
background-color: yellow !important;
};
And using method addStyleClass() add "UserClass" only to specific elements.
You may use CSS pseudo class for this purpose. Like this
form input[type=text]:focus{
background-color:red;
}
It will change the background-color of textbox from white to red whenever you click on it.
Here is the example http://jsfiddle.net/e284q9fv/
I get TableView like this:
TableView tableView = (TableView) ((AnchorPane) node).getChildren().get(0);
fill it with data like
tableView.setItems(FXCollections.observableList(vehicles));
this part is Ok. However, I'd like to change font properties of the currently row in the tableView and I cannot figure how to do it
I do not want to set tableView.getSelectionModel().setCellSelectionEnabled(true); as I want to display selection for the whole row, and not for a single cell
I tried to apply some css styles on TableRow and on Tabliew but without any success.
Is there any way to change font properties for the currently selected row in TableView?
Tableview css styling is subtle and complicated.
Solution
Go to the source for the default JavaFX controls css and copy all of the .table-view sections which have a :selected psuedo-class into your own user stylesheet.
Remove the default attribute setting rules from each css selector section you copied and replace them with the css you want to apply for your selected rows.
As there of lots of :selected rules you might have to copy the same attribute settings in a few places (similarly to how the default attribute values are defined).
Background Resources
The default stylesheets for respective versions are:
JavaFX 2.2 => caspian.css
Java 8 => modena.css
Consult the css reference guide and css tutorials if your are confused.
Quick Color Change Fix
Note that if all you need is to set the fill color for the selection bar text, you can override the default constant color with your own constant using a single statement:
.root { -fx-selection-bar-text: firebrick; }
Just substitute whatever color you want for firebrick. Similarly -fx-selection-bar: midnightblue; can be used to change the color of the background of the text.
This CSS Rule can be effective:
#mytable .table-cell {
-fx-text-fill:red ;
-fx-border-color: none;
}
#mytable .table-cell:hover {
-fx-text-fill: rgb(103,183,89) ;
-fx-border-color: none;
}