Skip to content

Bash with $ at front. #484

Closed Answered by minhperry
minhperry asked this question in Q&A
Oct 22, 2024 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

The compiled html has this structure:

<pre ...>
    <code class="language-bash" ...>
        <span class="line">Each line has a span</span>
    </code>
</pre>

I can inject a $ with CSS by simply using ::before:

code.language-bash>span.line::before { /*for the light theme*/
    content: "$";
    margin-right: 0.5rem;
    font-weight: bold;
    color: rgb(189, 176, 0);
}

.dark code.language-bash>span.line::before { /*for the dark theme*/
    color: rgb(255, 241, 46);
}

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@minhperry
Comment options

@minhperry
Comment options

@imfing
Comment options

Comment options

You must be logged in to vote
2 replies
@minhperry
Comment options

@imfing
Comment options

Answer selected by minhperry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants