Skip to content

Instantly share code, notes, and snippets.

@sportebois
Last active November 10, 2018 21:53
Show Gist options
  • Save sportebois/8b634a6df083ea237f4eef7bec8837b6 to your computer and use it in GitHub Desktop.
Save sportebois/8b634a6df083ea237f4eef7bec8837b6 to your computer and use it in GitHub Desktop.
Stylish rules to use FiraCode for code diffs and snippets in Github, Gitlab, Bitbucket and stackoverflow
/* Bitbucket */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
/* Bitbucket code and diffs */
.refract-content-container .line-numbers,
.refract-content-container .source {
font-family: 'Fira Code';
}
/* Bitbucket markdown rendering */
body.adg3 .wiki-content pre,
body.adg3 ak-editor-bitbucket .ProseMirror pre,
body.adg3 ak-editor-bitbucket .code,
body.adg3 code,
body.adg3 pre,
body.adg3 tt {
font-family: 'Fira Code';
}
/* applies to URLs on the domain bitbucket.org */
/* Github */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
.blob-code-inner,
.markdown-body .highlight pre,
.markdown-body pre, tt, code {
font-family: "Fira Code","SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;
font-feature-settings: "calt" 1;
font-variant-ligatures: contextual;
}
/* applies to URLs on the domain github.com */
/* For Firefox users: You might need to change incoming CSP headers to let the browser download FiraCode css and font:
- add https://cdn.rawgit.com/tonsky/FiraCode/ to the connect-src, style-src, and font-src, to get thise header:
Content-Security-Policy: default-src 'none'; base-uri 'self'; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com *.s3.amazonaws.com wss://live.github.com; font-src assets-cdn.github.com https://cdn.rawgit.com/tonsky/FiraCode/; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; img-src 'self' data: assets-cdn.github.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; manifest-src 'self'; media-src 'none'; script-src assets-cdn.github.com https://cdn.rawgit.com/tonsky/FiraCode/; style-src 'unsafe-inline' assets-cdn.github.com https://cdn.rawgit.com/tonsky/FiraCode/;
*/
/* Gitlab */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
/* Gitlab code */
.file-content.code pre code,
.diff-file .diff-content table {
font-family: 'Fira Code';
}
/* Gitlab markdown rendering */
.wiki code {
font-family: 'Fira Code';
}
/* applies to URLs on the domain gitlab.com */
/* Manning's livebooks */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
code {
font-family: 'Fira Code';
}
/* applies to URLs on the domain livebook.manning.com */
/* Medium */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
.graf--pre, .markup--blockquote-code, .markup--li-code, .markup--p-code {
font-family: 'Fira Code';
}
/* Applies to url matching the regexp .*\bmedium\b\.?[^/]*\/*.* */
/* Stackoverflow */
@import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
code {
font-family: 'Fira Code';
}
/* applies to URLs on the domain stackoverflow.com */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment