Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code blocks #16

Merged
merged 3 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 119 additions & 77 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,20 @@
@apply leading-tight;
}

.prose .list-none::before {
content: none;
}

.prose .link-external code,
.prose li code {
.prose li > code {
@apply inline py-px;
}

.prose blockquote pre,
.prose li pre {
@apply border mx-0 rounded-md;
}

.prose .list-none::before {
content: none;
}

.prose dl {
@apply ml-5;
}
Expand Down Expand Up @@ -271,110 +276,147 @@
text-decoration-color: theme('colors.red.600');
}

/*
highlight.js theme: GitHub
Author: github.com
Maintainer: @Hirse
/**
* GHColors theme for Prism by Avi Aryan (https://aviaryan.in/)
* Inspired by GitHub syntax coloring
*
* Slightly modified by me (Matias)
*/
pre[class*='language-'] {
color: #393a34;
}

Slightly modified by me
*/
.hljs {
color: #24292e;
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #999988;
font-style: italic;
}

.hljs-doctag,
.hljs-keyword,
.hljs-meta .hljs-keyword,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-variable.language_ {
color: #d73a49;
.token.namespace {
opacity: 0.75;
}

.hljs-title,
.hljs-title.class_,
.hljs-title.class_.inherited__,
.hljs-title.function_ {
color: #6f42c1;
.token.string,
.token.attr-value {
color: #e3116c;
}

.hljs-attr,
.hljs-attribute,
.hljs-literal,
.hljs-meta,
.hljs-number,
.hljs-operator,
.hljs-variable,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id {
color: #005cc5;
.token.punctuation,
.token.operator {
color: #393a34;
}

.hljs-regexp,
.hljs-string,
.hljs-meta .hljs-string {
color: #032f62;
.token.entity,
.token.url,
.token.symbol,
.token.number,
.token.boolean,
.token.variable,
.token.constant,
.token.property,
.token.regex,
.token.inserted {
color: #36acaa;
}

.hljs-built_in,
.hljs-symbol {
color: #e36209;
.token.atrule,
.token.keyword,
.token.attr-name {
color: #00a4db;
}

.hljs-comment,
.hljs-code,
.hljs-formula {
color: #6a737d;
.token.function,
.token.deleted {
color: #9a050f;
}

.hljs-name,
.hljs-quote,
.hljs-selector-tag,
.hljs-selector-pseudo {
color: #22863a;
.token.tag,
.token.selector {
color: #00009f;
}

.hljs-subst {
color: #24292e;
.token.important,
.token.bold {
font-weight: bold;
}

.hljs-section {
@apply font-bold;
color: #005cc5;
.token.italic {
font-style: italic;
}
/* End of theme */

.hljs-bullet {
color: #735c0f;
pre[class*='language-'] {
/* Needed by iOS Safari or some lines might wrap */
word-wrap: normal;
}

.hljs-emphasis,
.hljs-comment {
@apply italic;
.actual-code {
width: calc(100% + 2 * theme('margin.6'));
}
@screen sm {
.actual-code {
width: calc(100% + 2 * theme('margin.5'));
}
}

.hljs-strong {
@apply font-bold;
pre[class*='language-'] .token {
/* Without this, line highlights would be over the actual code */
@apply relative;
}
/* End of the GitHub highlight.js theme */

.hljs-addition,
.hljs-deletion {
@apply inline-block -ml-6 pl-6 sm:-ml-5 sm:pl-5;
width: calc(100% + 2 * theme('margin.6'));
.token.prefix.inserted {
color: #008000;
}
.hljs-addition {
@apply bg-green-200 text-green-800;
.token.prefix.deleted {
color: #d91e18;
}
.hljs-deletion {
@apply bg-red-200 text-red-800;

.token.inserted-sign,
.token.deleted-sign {
@apply flow-root -ml-6 pl-6 sm:-ml-5 sm:pl-5;
width: calc(100% + theme('margin.6'));
}
@screen sm {
.token.inserted-sign,
.token.deleted-sign {
width: calc(100% + theme('margin.5'));
}
}

.token.inserted-sign {
background: linear-gradient(
to right,
theme('colors.green.300'),
theme('colors.green.300') theme('borderWidth.6'),
theme('colors.green.100') theme('borderWidth.6')
);
}
.token.deleted-sign {
background: linear-gradient(
to right,
theme('colors.red.300'),
theme('colors.red.300') theme('borderWidth.6'),
theme('colors.red.100') theme('borderWidth.6')
);
}
@screen sm {
.hljs-addition,
.hljs-deletion {
width: calc(100% + 2 * theme('margin.5'));
.token.inserted-sign {
background: linear-gradient(
to right,
theme('colors.green.300'),
theme('colors.green.300') theme('borderWidth.4'),
theme('colors.green.100') theme('borderWidth.4')
);
}
.token.deleted-sign {
background: linear-gradient(
to right,
theme('colors.red.300'),
theme('colors.red.300') theme('borderWidth.4'),
theme('colors.red.100') theme('borderWidth.4')
);
}
}
}
Loading