pretty-checkbox icon indicating copy to clipboard operation
pretty-checkbox copied to clipboard

Toggle disabled

Open orioljd opened this issue 8 years ago • 4 comments

If the input is disabled it doesn't change the opacity.

orioljd avatar Mar 20 '18 09:03 orioljd

Hi @orioljd ,

Can you please provide bit more info?

lokesh-coder avatar Mar 20 '18 10:03 lokesh-coder

For example in the page documentation https://lokesh-coder.github.io/pretty-checkbox/:

<div class="pretty p-default p-curve p-toggle">
  <input type="checkbox" disabled />
    <div class="state p-success p-on">
      <label>Subscribed</label>
    </div>
    <div class="state p-danger p-off">
      <label>Subscribe </label>
    </div>
</div>

if you put the disabled property in the input tag it is disabled, but doesn't style the opacity.

orioljd avatar Mar 20 '18 13:03 orioljd

The problem is the "p-on" and "p-off" classes that set opacity of the input = 1.

rafaelblink avatar Mar 20 '18 17:03 rafaelblink

I'm having the same issue at the moment. p-on and p-off overwrite the opacity value given by pretty input[disabled] ~ *.

Since I don't need to have this attribute changed multiple times in my code, using the following can help as a quick fix:

.pretty input[disabled] ~ * {
    opacity: 0.5 !important;
}

penuts7644 avatar Oct 13 '18 17:10 penuts7644