Skip to content

Instantly share code, notes, and snippets.

@higby
Created July 6, 2023 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save higby/dd13c29baf12102a4030615f91b4212a to your computer and use it in GitHub Desktop.
Save higby/dd13c29baf12102a4030615f91b4212a to your computer and use it in GitHub Desktop.
Consistent Pre & Code Font-Sizing
pre, code {
font-size: .95em;
}
pre code {
font-size: inherit;
}
@higby
Copy link
Author

higby commented Jul 6, 2023

Example:

pre, code {
  font-family: $font-family-mono;
  font-size: .95em;
  background-color: var(--background-emphasis);
  border-radius: .25rem;
}

pre {
  padding: .75rem 2rem;
  code {
    padding: 0;
    border-radius: 0;
    font-size: inherit;
  }
}

code {
  padding: 0.2rem 0.4rem;
}

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