sethyuan / logseq-plugin-tocgen

Generate a TOC of any page anywhere to quickly access the page's content.
MIT License
144 stars 10 forks source link

[SOLVED] Changing the font #68

Closed DutchPete closed 1 year ago

DutchPete commented 1 year ago

In the ToC I would like to change the H2 font to uppercase, i.e. text-transform: uppercase; and for the H3 header I would like font-variant: small-caps;.

I tried to find the selector via the dev tools but could not. Please advise.

sethyuan commented 1 year ago

I updated a version that includes this level information.

image

DutchPete commented 1 year ago

Thanks for that. I updated the plug-in.

If I do

.kef-tocgen-block {
  text-transform: uppercase !important;
}

it transforms everything to upper case. How can I target specifically h2? I tried adding .h2.uniline-block but that does not work.

sethyuan commented 1 year ago

You have to write rules like this:

.kef-tocgen-block[data-level="1"] {
  text-transform: uppercase;
}
.kef-tocgen-block[data-level="2"] {
  font-variant: small-caps;
}
DutchPete commented 1 year ago

Many thanks. Logseq css code is different from Obsidian css code is some ways - I came from Obsidian.