Skip to content

Some CSS I am using to fix the codeblock alignment issue #65

Description

@lyricat

Just found that <textarea> and <pre><code> don’t share exactly the same default typography.

So I wrote some CSS to override the defaults:

.overtype-preview .code-block {
    /* to avoid the scrollbar, which has the additional height to break the alignment. */
    white-space: break-spaces; 
}

.overtype-preview .code-block code {
    /* use the exactly the same font that textarea is using */
    font-family: "SF Mono", SFMono-Regular, Menlo, Monaco, "Cascadia Code", Consolas, "Roboto Mono", "Noto Sans Mono", "Droid Sans Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "Courier New", Courier, monospace !important;
    /* set line-height to zero to avoid unknown height alignment issue */
    line-height: 0px !important;
}

hope that help you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions