AnubisNekhet / AnuPpuccin

Personal theme for Obsidian
GNU General Public License v3.0
1.96k stars 163 forks source link

[Feature Request] Abstract the "Minimal Cards Tweak" code into a toggle option #262

Open HynDuf opened 3 months ago

HynDuf commented 3 months ago

Feature Description Recently, I try using "Minimal Card" css snippet from kepano Minimal theme and notice the unexpected margin of the image in the card. Search around and the culprit was the Minimal Card Tweak code. It would be better if the user can toggle that on or off depends if they want it or not. Thanks.

The part of code is:

/*-------Tweak for Minimal Cards--------------
Minimal cards are a snippet designed by Kepano for the Minimal theme.
None of the original code was used in this theme, and the following code is merely some tweaks to the snippet.
--------------------------------------------*/
.cards .table-view-table > tbody > tr > td:last-child {
  border-bottom-color: transparent !important; /*-No border for last cell-*/
}
.cards .table-view-table > tbody > tr > td:first-child {
  width: 100% !important; /*-Max width for first cell-*/
  border-bottom: 1px dashed var(--background-modifier-border) !important; /*-Border for first table that spans to the end because of max width-*/
}
.cards .table-view-table > tbody > tr > td:first-child span {
  margin: 2px calc(var(--cards-padding) * 0.5) 0 calc(var(--cards-padding) * 0.5); /*-Add padding to text-*/
}
.cards .table-view-table > tbody > tr > td:first-child span a {
  padding: 0 !important; /*-0 padding on link-*/
}
.cards .table-view-table > tbody > tr > td:not(:last-child):not(:first-child) > .el-p.el-p.el-p:not(.el-embed-image) {
  border-bottom: 1px dashed var(--background-modifier-border);
}
.cards:not([class*=cards-cols-]) {
  --cards-columns: repeat(auto-fit, minmax(var(--cards-min-width), var(--cards-max-width))); /*-force card width to be obeyed on notes not having cards-cols css class-*/
}
...

Here is before I commented those code off image

Here is after (notice the left margin disappear) image

I don't know if it's my css snippets' faults or not, but that margin: 2px... might be the reason.