vaga / hugo-theme-m10c

A minimalistic (m10c) blog theme for Hugo
https://themes.gohugo.io/hugo-theme-m10c/
MIT License
471 stars 294 forks source link

Duplicate padding for preformatted text with line numbers #54

Closed oofnikj closed 3 years ago

oofnikj commented 3 years ago

Hi, first off thanks for your work on this theme!

When using the highlight shortcode with linenos=table, the left-hand border appears in both tables. In addition, a border appears around the table whereas it does not for linenos=inline or linenos=false:

Screenshot from 2020-12-30 09-27-51

I work around this with the following SCSS:

 // get rid of duplicate padding element in pre-formatted content
.post-content td:nth-child(2) pre {
  border: 0;
}

// border around pre-formatted tables
.post-content div.highlight div {
  background-color: unset !important;
}

Result: Screenshot from 2020-12-30 09-39-30

I think it is more visually consistent to only have the border on the first cell. There is probably a better way of doing this (especially the !important hack - I couldn't get it to work otherwise), but I'm not so good with styling.

vaga commented 3 years ago

Nice catch! Thanks.