Is it possible to achieve proper .org heading formatting with custom.css?

So, I’m using .org files for my Logseq graph. In markdown, I can simply use normal markdown headings - ## for h2 and so on. But in an .org file, heading levels are implied alongside indentation by the number of of asterisks at the start of a line - ** for h2 etc.

It’s my understanding that because there is no additional way to define heading levels in .org, this:

* Some Heading
** Some Sub-Heading

is really equivalent to this markdown:

- # Some Heading
    - ## Some Sub-Heading

but Logseq renders it like:

- Some Heading
    - Some Sub-Heading

Is it possible to make Logseq render * top-level headings, ** next level headings, etc. how they would be displayed in the equivalent markdown? If so, how would I do this?

2 Likes

Hi, @SonarMonkey ! Not sure if you still need it, but here is how I style Org headings:

:has(+ .block-body) {
  font-weight: bold;
}

The content of an Org block (everything excluding the heading) receives the block-body HTML class. So, to style it, we need to select an HTML element that has as next sibling and element with that class. That’s what the :has(+ .block-body) selector means.

Once you’ve found the right element, you can style the way you prefer.

1 Like