Skip to content

How to set a font family for highlighjs component #55

@SausageDogger

Description

@SausageDogger

I tried using CSS to set a font family for highlighted code ,but it didn‘t work.
I was confused because it seems that there is not an official way to set a font family for highlightJS
When I using native highlightJS and <pre><code>, .hljs it works

/* a div contained a highlightjs component */
#box{
  font-family: 'JetBrainsMono-Regular';
}

.highlightjs {
  font-family: 'JetBrainsMono-Regular';
}

.hljs {
  font-family: 'JetBrainsMono-Regular';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions