Hello, I am looking to enhance the visual appeal of my web application using GWT CSSResource.
One thing that I am struggling with is styling a simple hyperlink.
In traditional CSS, I would typically do the following:
a{color: #somecolor}
a:hover{color: #somecolor}
a:visited{color: #somecolor}
But how can I achieve this using CSSResource?
Below is my attempt:
My CSSResource interface looks like this:
public interface CiColors
extends CssResource
{
public String backgroundColor1();
public String backgroundColor2();
public String fontColor();
public String mainColor();
@ClassName ( "mainBorderColor")
public String mainBorderColor();
public String infoBackground();
public String captionColor();
@ClassName("a")
public String linkColor();
}
Here is an excerpt from the CSS file:
.backgroundColor1 {
background-color: black;
}
.backgroundColor2 {
background-color: black;
}
.infoBackground{
background-color: lightgrey;
}
.fontColor {
color: #FF8F35;
}
.mainColor {
background: FF8F35;
}
.mainBorderColor {
border-color: #FF8F35;
}
.captionColor{
color: #FF8F35;
}
a{
color: #FF8F35;
}
Adding the 'linkColor()' style gives me an error. Ideally, I would like the font color and hyperlink color to be the same without needing another CSS class.
Below is the Java code where the hyperlink is constructed. Please note that there is no ui.xml file present.
[Java code snippet omitted for brevity]Is there a way to achieve this? Any insights would be greatly appreciated.
Thank you in advance.