Skip to content

Rounding artefacts with dark table row #146

@RamonvdW

Description

@RamonvdW

global.scss contain this style:

td, th{
  padding: 15px 5px;
  display: table-cell;
  text-align: left;
  vertical-align: middle;
  border-radius: 2px;  // this causes issues
}

The border radius is not visible when the table cell background color is identical to all cells around it.
When highlighting a table row by changing the background color, the area between each adjacent td in that row shows the rounding effects: a few white pixels on every corner.

Material design does not specify any rounding on table cells.
See https://material.io/archive/guidelines/components/data-tables.html

Snippet to reproduce the issue:

<table class="white">
   <tr><td>First</td><td>Second</td><td>Third</td></tr>
   <tr class="darkgreen"><td>First</td><td>Second</td><td>Third</td></tr>
   <tr><td>First</td><td>Second</td><td>Third</td></tr>
<table>

Example:
image

I have not found any component in materializecss where the border rounding of td or th elements is useful. I might have missed one - please reply and let me know.

Proposed solution: change line marked above from 2px to 0.

Environment:

  • Visible with Chrome version 91.0 (and many versions back) on Debian 10 and Windows 10
  • Not visible with Firefox 78.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    css/sassFor something that related to styling/view

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions