argyleink / open-props

CSS custom properties to help accelerate adaptive and consistent design.
https://open-props.style
MIT License
4.78k stars 193 forks source link

fix breaking centered text-alignment for td, th #400

Closed kalligator closed 1 year ago

kalligator commented 1 year ago

I noticed that :where(td,th) has text-align: left set, which messes things up when td or th has align="center" in their html tag.

I fixed this issue, but I think it would be better to remove the alignment from :where(td,th) altogether, because it might also cause problems for right-to-left users.

stackblitz[bot] commented 1 year ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

argyleink commented 1 year ago

Thank you for filing this 🙂

I'm surprised I committed a physical property for text alignment, I assumed I would have committed text-align: start.

What if we did this:

:where(td:not([align]), th:not([align])) {
  text-align: start;
}

this way

kalligator commented 1 year ago

That sounds a lot better indeed!