-3

I'm playing a little bit with my GTK3-Theme on Ubuntu. When i move the Mouse over the scrollbar button the button is changed - but only if the Button is enabled. If the Button is disabled (because the Slider can't be moved in this direction) nothing happens when i move the mouse over the button.

I want to have the same style for enabled and disabled Buttons. This don't work:

scrollbar button:hover:disabled { <style> }
tim.t
  • 1
  • 1

2 Answers2

1

Try this:

button[disabled]:hover { /* styling goes here */ }
ed2
  • 1,457
  • 1
  • 9
  • 26
  • Don't work. It seems thats something that doesn't work with the GTK file. When i try this for enabled buttons with i have the same - no effect. – tim.t Sep 29 '21 at 07:59
  • Could it be a CSS file or resource load order? For troubleshooting purposes, you could try using `!important` in the relevant stylings, then judge next step based on if that works or not (don't worry, I'm not suggesting it as a permanent solution). – ed2 Sep 29 '21 at 11:05
  • you mean 'background-image: linear-gradient(to right, red, red) !important'? no effect. is it at all possible to combine the pseudo classes :disabled and :hover? – tim.t Sep 29 '21 at 12:01
  • You could try literally `button:disabled:hover`, though it may depend on how GTK sets the disabled attribute. You could try a few possibilities to see if any stick, literally trial and error, like `button[disabled="1"]:hover`, `button[disabled=1]:hover`, `button[disabled="True"]:hover`, `button[disabled="disabled"]:hover` – ed2 Sep 29 '21 at 12:22
0

You can do something like this for all :

scrollbar {
   my: style;
}

If you want for only disabled <button> with the given class :

button.my-class:disabled {
   background-color: red;
}
<div>
   <button class="my-class" disabled>Disabled</button><br>
   <button class="my-class">Enable</button><br>
   <input class="my-class" type="text" disabled/><br>
   Text disabled not button
</div>
Elikill58
  • 4,050
  • 24
  • 23
  • 45
  • this changes the style of the whole scrollbar. Thats not what i want. I want to change the style of disabled buttons. – tim.t Sep 29 '21 at 07:57
  • Is that what you want now ? – Elikill58 Sep 29 '21 at 08:06
  • No. i don't want to change the whole scrollbar only the disabled buttons. – tim.t Sep 29 '21 at 08:29
  • I don't change the scrollbar. And in your question you ask for disabled and enabled. Please be sure of what you want – Elikill58 Sep 29 '21 at 08:31
  • now i understand what YOU mean. i dont want to disable the scrollbar. when i use buttons ("arrows") at the scrollbar and the slider is at the top then the button is "disabled". this means i can't move the slider anymore. I can move the slider with the button at the end of the scrollbar down. when the slider is at the bottom the down button is 'disabled'. when the slider is in the middle both are 'enabled' (can be used). i can customize the background-color for the disabled button with 'scrollbar button:disabled' but not together with hover: 'scrollbar button:disabled:hover' doesn't work. – tim.t Sep 29 '21 at 11:53