These are chat archives for less/less.js

20th
Sep 2017
alleac
@alleac
Sep 20 2017 10:02
Hi. I would like know the syntax for styling a disabled Element.
#testerLess[disabled] { cursor: not-allowed; background-color: blue !important; }
I've been using above with no success. Any tips?
Calvin Juárez
@calvinjuarez
Sep 20 2017 15:48

@alleac That looks like valid CSS. But are you trying to use it as a Less mixin? If so, you could do something like this:

.disabled-state {
  &[disabled] {
    cursor: not-allowed;
    background-color: blue !important;
  }
}

Then you'd just use it like this:

input, select, textarea {
  .disabled-state();
}