How to Change the Vaadin-Select Hover colour - vaadin14

Current Hover Color
I want to change the hover color when we move mouse over the items in the vaadin-select box, by default its coming in light blue color as seen in screenshot 1 but I want to change to some other color. How to do that ?
I have tried by adding
:host(:hover) {
background-color: #9cbdd6;
}
and importing as
#CssImport(value = "./styles/vaadin-select-items.css", themeFor = "vaadin-item")
Inspecting Vaadin Select
The below answer worked perfectly for the above problem,
However There is one problem happening the hover color is coming when the dropdown is closed also means the overlay is not opened. How to stop that ?
I need only to modify the hover color on the overlay as below which is happening correctly via the mentioned code but need to stop the above.
Hover color on the overlay items
Also applying theme like this is applied on all overlay items, how to apply these styles uniquely for some components.

You're on the right track, but you'll need a strong selector. If you're willing to use !important, this will work:
:host(:hover:not([disabled])) {
background: red !important;
}

Related

TextInputLayout hint color for various states

I have been trying to customize the Hint color in TextInputLayout and it works fine. But the problem is that I have to define color when there is an error, normal/Activated which is working and disabled state of the field.
So I tried creating three different styles with color normal, color activated and so on. But this doesn't seem to change the colour. I have indicated the Appcombat theme as the parent theme as well in my custom styles. I have tried applying these styles through java file as well.
Also let me know on how to define the size of the Hint text through style.
A bit late to the party, but here goes my solution to this:
Set the same style in errorTextAppearance and hintTextAppearance, both with the same color for the item android:textColor. When showing an error, set the error using a spannable with a ForegroundColorSpan with the color you wish to display in the error field, while the hint will remain in the color defined by the style set in errorTextAppearance.

D3: Set background colour for a chart

I'm working on a visualisation involving stacked histogram with really thin bars.
The problem is that white background introduces unpleasant visual vibration and make bars somewhat hard to interpret:
http://i.stack.imgur.com/GN0XD.png
What I'm looking for is a way to set a specific colour for chart background. I've tried to set it for SVG element like so:
svg {
background-color: #ccc;
}
But (obviously) it doesn't work properly:
http://i.stack.imgur.com/ctbYo.png
How do I set a background colour so that it'll be exactly the same shape as a chart?
I managed to come to this quick-and-dirty solution. Just adding a one pixel pseudo-shadow to the right of each bar:
rect {
-webkit-svg-shadow: 1px 0px #ccc;
}
Produces this:
http://i.stack.imgur.com/xSVOD.png
How is the chart being instantiated? by using svg { background-color: #ccc;} you are setting the background color of all svg elements to #ccc (except where over-ridden), so if your chart is a child of another svg element with some margins it would explain why the alignment is no good.
One strategy to go about fixing may be to use your browser's debugging abilities (ctrl+shift+i to bring up 'developer tools' in chrome) to take a look at the DOM elements and try to narrow down which ones cover which areas of the graph vs the areas of the graph plus the margins on the bottom/left. not sure about other browsers but chrome is useful in that if you hover over an element in the html document it will 'highlight' that element in the browser. This might help you narrow down which objects specifically need to be stylized.

Changing the color of Dimple.js tooltip helper lines

I am plotting a standard bar chart using dimple.js and am able to change the color of the tooltip box and the bars but the x,y helper lines that pop-up when you mouseover a bar remain the original color and I can't figure out how to change them.
This is a tricky problem because it's not well supported by Dimple. There isn't a class applied to those lines so you can't target them with a classname for css (the other tooltip objects do have a classname, but the line element is separate from those). Here's what the tooltip HTML looks like, for reference :
That first <line> element is what we want. I found two options that work but are hackish.
1) Use CSS to target the lines - the tooltip is added as a <g> group after everything else in the svg, so you can look for the first line element(s) in that group:
svg > g:last-of-type > line {
stroke: lightgrey !important;
opacity: 0.55 !important;
}
This only works for your particular use case of changing the line for every element - it isn't dependent on the color of the bars, if they were different.
2) The lines originally get their color by looking at the fill attribute of the bar - which is still whatever it was originally set to even if you mask it later with css. So one thing you can do is override the original color (since you will mask it later anyway).
myChart.addSeries("Cancer", dimple.plot.bar);
myChart.defaultColors = [
new dimple.color("lightgrey")
];
Other than that, I can't think of a way to get the lines to match colors which are only specified in css without a change in the library. (Or writing your own tooltip function).

Exporting transparent background using Fireworks

I'm pretty new to Fireworks. I drew an orange rectangle and made it semi-transparent. My web page has a patterned background which I'd like to be able to see through my div, but I can't change the opacity of the div in CSS as the div contains other divs that also become transparent using this CSS when I don't want them to!
I've tried loads of things I found on Google but to no avail. Can anyone help?
If you want to know how to export the semi-transparent rectangle from Fireworks so it stays that way, just make sure your canvas color is set to none (the box with a red diagonal line through it) and then export it as a PNG-32.
I'm not sure I understood what you mean by DIVs becoming transparent when using CSS. Can you elaborate on that a bit?

Transparency problem with gradient - Label in a Panel on a UserControl, ultimately displayed on parent Form

I know this has been asked many times, but not quite the way I'm trying to solve it.
I have Labels in a Panel on a UserControl, and the UserControl goes onto a form.
The Label.BackColor = Transparent.
The panel is from DevExpress, and I've set a gradient background.
Problem: The Labels aren't transparent; they each show as a white solid rectangle around the text. (I presume the white comes from the Panel, as the first of the two gradient colors is White.)
Everything I google about this problem says I need to roll my own Label control and fire off peculiar GDI+ commands, and Invalidate the control, and hook the Paint event and sing a stirring sea shanty and hold one foot above my head and...
Really? Doesn't the Label allow ".BackColor=Transparent" ? Why doesn't that work?
And what's the best way through this?
Somehow it turns out I never tried making the Label backgrounds transparent.
I am not a proud.

Resources