Trying to set light-height for markdown preview in styles.css


#1

First day with the product. I’m trying to get markdown to look as close to StackOverflow.com’s markdown for questions and answers, as possible.

So far I’ve added the following CSS to styles.css, and it does what I want, goes into effect immediately upon saving.

But when I add things like line-height or code { } to set code block styles they seem to be ignored.
The inter-line gap is wider than on Stack Overflow.

I’ve tried a lot of combinations with .markdown-preview, .markdown-body, and poking around, but no luck.

Any suggestions?

.markdown-preview.markdown-preview {
  font-family: "Arial";
  font-size: 24px;
  blockquote {
    background-color: #fff5cc;
    border-width: 0px;
  }
  hr {
    border-top: 1px solid #bbbbbb;
    background: none;
  }
}

Thanks!


#2

What package are you using?


#3

Installed whatever the default for macOS is.


#4

Release 11.13.1 X64


#5

If you mean 1.13.1, that’s the version of Atom, which is not what I asked for. There are a number of packages to preview markdown files and you have not stated which one you are using. Is it the one built into Atom, markdown-preview?

Because markdown-preview doesn’t just convert markdown to HTML, so you’re not getting any code elements. If you look in the dev tools, you’ll see that a code block is converted to an atom-text-editor element and treated in much the same way as code in an actual editor. If you try something like .markdown-preview atom-text-editor .line { line-height: 90% }, you’ll see what I mean.


#6

love that it’s configurable, but that’s a bit more reverse engineering and idiosyncratic than I’m prepared to deal with right at the moment. I did test it and it impacted the blockquote line height but not the rest, but it didn’t look right even at that. I can’t invest that much time trying to figure out how to make basic adjustments, so I’m now working with macdown. I have it looking virtually identical to StackOverflow’s markdown now, but it doesn’t honor the tags so now I’m looking at building that from source. sigh. But I was able to get further by my own devices so that was encouraging. Thanks for your time and the answer though.