Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ngx-datatable css styling for mouse hover

I'm using ngx-datatable with the bootstrap theme. I can't find or figure out how to change the styling for when the mouse is hovered over a cells?. In this example it goes grey

http://swimlane.github.io/ngx-datatable/#css

I've been able to change the activation colour like this, just can't figure out the hover colour.

::ng-deep .ngx-datatable.bootstrap .datatable-body .datatable-body-
row.active {
  background-color: #006eff;
  color: #FFF;
}
like image 522
Tim Tharratt Avatar asked Feb 17 '18 11:02

Tim Tharratt


2 Answers

.ngx-datatable.bootstrap:not(.cell-selection) .datatable-body-row:hover,
.ngx-datatable.material:not(.cell-selection) .datatable-body-row:hover .datatable-row-group
{ 
   background: red;
}

This works.

like image 179
C.Schubert Avatar answered Oct 28 '22 09:10

C.Schubert


 :host
  ::ng-deep
  .ngx-datatable.bootstrap:not(.cell-selection)
  .datatable-body-row:hover,
:host
  ::ng-deep
  .ngx-datatable.material:not(.cell-selection)
  .datatable-body-row:hover
  .datatable-row-group {
  background: red;
}

I had to add

    :host
  ::ng-deep

and then it stared working.

You can change other default styles because there is a linear translation:

:host
  ::ng-deep
  .ngx-datatable.material:not(.cell-selection)
  .datatable-body-row:hover {
  background-color: #007bff2e;
}
like image 40
BartusZak Avatar answered Oct 28 '22 08:10

BartusZak