Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding artefacts with dark table row #146

Closed
RamonvdW opened this issue Jun 5, 2021 · 2 comments · Fixed by #149
Closed

Rounding artefacts with dark table row #146

RamonvdW opened this issue Jun 5, 2021 · 2 comments · Fixed by #149
Labels
css/sass For something that related to styling/view

Comments

@RamonvdW
Copy link

RamonvdW commented Jun 5, 2021

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
@Smankusors Smankusors added the css/sass For something that related to styling/view label Jun 6, 2021
@Smankusors
Copy link
Member

Smankusors commented Jun 6, 2021

Honestly, I'm just realized the app that I have developed for 3 years have a CSS override like this.

td,th {
	border-radius: 0 !important;
}

Stupid past me 🤦, there's no documentation why this CSS rule exist. Perhaps this artefact is the reason...


Looking on the commit from 7 years ago, I don't think there's any reason removing border-radius would cause any UI problem. Feel free to create a PR to fix this issue. The line you looking is here :

border-radius: 2px;


On the other hand, there's border-radius: 0 if you use striped class. Perhaps if line above removed, these lines are also safe to removed?

> tr > td {
border-radius: 0;
}

What do you think about this? Safe to remove both of these rules? @materializecss/members

@roiLeo
Copy link
Member

roiLeo commented Jun 7, 2021

I can't find the purpose of using border-radius in table cells, I think we can safely remove it.

DanielRuf added a commit that referenced this issue Jul 5, 2021
Fix for issue #146 (Rounding artefacts with dark table row)
@wuda-io wuda-io closed this as completed Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css/sass For something that related to styling/view
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants