operasoftware / dns-ui

Opera's LDAP-authenticated PowerDNS user interface
Apache License 2.0
283 stars 57 forks source link

Apply data-* attributes to table columns for user defined styles #154

Closed uedvt359 closed 4 years ago

uedvt359 commented 5 years ago

Hi, we've got a fourth PR: This one will make it easy to apply user-defined styles on the zones tables. We use it for example to highlight different Classifications in different colours using this stylesheet. Again, we're happy to make any changes required to get this merged!

tr[data-account="internal"]>td.account {
  background-color: #d9edf7;
}
tr[data-account="internal"]:hover>td.account,
tr[data-account="internal"]>td.account:hover {
  background-color: #c4e3f3;
}

The a bit verbose data- attributes were chosen for maximum flexibility: a on-site-administrator can easily get at all the data and manipulate it with CSS (or even JavaScript).

The stylesheet could also be used to apply styles to the header and footer (we use it to distinguish between preproduction and production, for example).