Question

I would like to add a shadow to gnome-shell panel in default theme. I've edited "/usr/share/gnome-shell/theme/gnome-shell.css" and succesfully removed background color (atl+f2 + r to apply). I've also added a box-shadow property like this:

#panel {
    background-color: transparent;
    font-weight: bold;
    height: 1.86em;
    box-shadow: 0px 3px 10px black;
}

...that, if applied to a div in a html page, would give me what I expect. Unfortunalelly it seems to be ignored by gnome-shell. Is something similar available in gnome-shell?

Was it helpful?

Solution

...ok, I've found out where the problem is. Unlikewise HTML, the shadow alpha is also affected by panel background alpha. So a black shadow (alpha=1) on a transparent background panel, would result in a transparent (thus insvisible) shadow. So by setting

background-color: rgba(0,0,0,0.5);
font-weight: bold;
height: 1.86em;
box-shadow: 0px 3px 10px rgba(0,0,0,0.5);

It would result on a 0.25 alpha shadow (0.5 * 0.5 = 0.25). That's why the box-shadow effect from my question above is not shown. As said, that's a different behaviour than HTML where a transparent background div would not affect its box-shadow effect. Perhaps some gnome-shell developer passing by here might want to consider this implementation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top