-1

In following example I'm reverting some color-changes made by a package:

table.somePluginTable{
    & tbody, thead {
        & tr {
           & > .alt-fixed-left,
           & > .alt-fixed-right {
               background-color: revert;
           }
        }
    }
}
  1. Can this be less nested? e.g. can the & tr be with the & > .alt-fixed-l as & tr > .alt-fixed-l?
  2. or is it faster to use & tr > [class^=".alt-fixed-"]? //(for selecting both at the same time)
  • have you read https://stackoverflow.com/questions/49401307/what-is-the-meaning-of-an-ampersand-in-less-selectors ? – Martin Jun 02 '22 at 10:03
  • are there any styles set in your table, thead tbody or tr brackets ? – Martin Jun 02 '22 at 10:05
  • If not,. then you can simply reduce all of the above three parts down to a single line: `table.somePluginTable tr {` (if you use `tfoot` you'd need to qualify that with a `:not` maybe) – Martin Jun 02 '22 at 10:06
  • @Martin Thanks! Didn't realize the `tbody, thead` line was unnecessary... I turned the 5 lines into: `table.somePluginTable tr > [class^="alt-fixed-"]` – Four Legs 'n' Lil Roller Jun 02 '22 at 10:53

0 Answers0