2023-08-11 08:50:22 +00:00
|
|
|
/** Define CSS Variables */
|
|
|
|
|
body {
|
|
|
|
|
/* Codeblock Body */
|
|
|
|
|
--border-radius: 10px;
|
|
|
|
|
--gradient-background-colour: transparent;
|
|
|
|
|
--code-padding: 8px;
|
|
|
|
|
--container-height: calc(var(--language-icon-size) + 2 * var(--header-inner-vertical-padding) * var(--header-font-size));
|
|
|
|
|
--container-min-height: calc((var(--header-font-size) + 2 * var(--header-inner-vertical-padding) * var(--header-font-size)) * var(--line-height-normal));
|
|
|
|
|
--language-border-colour: var(--code-styler-codeblock-background-colour);
|
|
|
|
|
--language-border-width: 0px;
|
|
|
|
|
|
|
|
|
|
/* Header */
|
|
|
|
|
--header-font-size: var(--code-size);
|
|
|
|
|
--header-padding: 0px;
|
|
|
|
|
--header-inner-vertical-padding: 0.3;
|
|
|
|
|
--header-spacing: 15px;
|
|
|
|
|
--header-button-spacing: 14px;
|
|
|
|
|
--header-separator-width: 2px;
|
|
|
|
|
--header-separator-width-padding: var(--header-separator-width);
|
|
|
|
|
--code-styler-header-border: none;
|
2023-08-23 23:56:40 +00:00
|
|
|
--folded-bottom-border: 0 solid transparent;
|
2023-08-11 08:50:22 +00:00
|
|
|
--language-icon-size: 28px;
|
|
|
|
|
--language-icon-filter: none;
|
|
|
|
|
|
|
|
|
|
/* Lines */
|
|
|
|
|
--gradient-highlights-colour-stop: 100%;
|
|
|
|
|
|
|
|
|
|
/* Line Numbers */
|
|
|
|
|
--line-number-height-correction: 2px;
|
|
|
|
|
--line-number-gutter-padding: 16px;
|
|
|
|
|
--line-number-gutter-min-width: 32.67px;
|
|
|
|
|
|
|
|
|
|
/* Line Text */
|
|
|
|
|
--line-wrapping: pre-wrap;
|
|
|
|
|
--line-active-wrapping: var(--line-wrapping);
|
|
|
|
|
|
|
|
|
|
/* Buttons */
|
|
|
|
|
--code-styler-button-colour: var(--text-muted);
|
|
|
|
|
--code-styler-button-active-colour: white;
|
|
|
|
|
--duration-button: 240ms;
|
|
|
|
|
--dent-difference: 30px;
|
|
|
|
|
--polygon-in: polygon(0 0, 16px 0, 16px 36px, 0 36px);
|
|
|
|
|
--polygon-out: polygon(0 0, 100% 0, 100% 100%, 0 100%);
|
|
|
|
|
--copy-code-header-right-margin: calc(3 * var(--header-button-spacing));
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-08 23:26:11 +00:00
|
|
|
/** Pre elements */
|
|
|
|
|
.code-styler-pre-parent{
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
.code-styler pre.code-styler-pre {
|
2023-08-11 14:01:29 +00:00
|
|
|
overflow: hidden !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
min-height: unset;
|
|
|
|
|
padding: 0px !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
border-radius: var(--border-radius) !important;
|
|
|
|
|
background: var(--code-styler-codeblock-background-colour) !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
.code-styler pre.code-styler-pre[class*='language-'] {
|
|
|
|
|
padding-left: var(--language-border-width) !important;
|
2023-08-16 13:27:05 +00:00
|
|
|
background: linear-gradient(90deg, var(--language-border-colour), var(--language-border-colour) var(--language-border-width), var(--code-styler-codeblock-background-colour) var(--language-border-width), var(--code-styler-codeblock-background-colour) 100%), var(--code-styler-codeblock-background-colour) !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-20 13:40:22 +00:00
|
|
|
.code-styler pre > code {
|
2023-08-08 15:20:57 +00:00
|
|
|
padding-top: var(--code-padding) !important;
|
|
|
|
|
padding-bottom: var(--code-padding) !important;
|
|
|
|
|
}
|
2023-08-09 17:15:43 +00:00
|
|
|
.code-styler pre.code-styler-pre > code {
|
2023-07-08 23:26:11 +00:00
|
|
|
display: grid;
|
2023-08-11 14:01:29 +00:00
|
|
|
max-height: unset;
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-top: var(--code-padding) !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
padding-right: 0px !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-bottom: var(--code-padding) !important;
|
|
|
|
|
padding-left: 0px !important;
|
|
|
|
|
border-radius: 0px !important;
|
|
|
|
|
background: none !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
grid-template-columns: min-content auto;
|
|
|
|
|
grid-template-rows: auto;
|
|
|
|
|
overflow-x: overlay;
|
2023-08-09 08:14:40 +00:00
|
|
|
transition-duration: var(--duration-button);
|
2023-08-11 14:01:29 +00:00
|
|
|
transition-property: max-height, padding, border-top;
|
2023-08-09 08:14:40 +00:00
|
|
|
transition-timing-function: ease-in-out;
|
2023-08-16 13:27:05 +00:00
|
|
|
white-space: var(--line-wrapping) !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-10 13:45:16 +00:00
|
|
|
.code-styler pre.code-styler-pre.wrapped > code {
|
|
|
|
|
--line-wrapping: pre-wrap;
|
2023-08-27 08:11:54 +00:00
|
|
|
--line-active-wrapping: pre-wrap;
|
2023-08-10 13:45:16 +00:00
|
|
|
}
|
|
|
|
|
.code-styler pre.code-styler-pre.unwrapped > code {
|
|
|
|
|
--line-wrapping: pre;
|
|
|
|
|
--line-active-wrapping: pre;
|
|
|
|
|
}
|
|
|
|
|
.code-styler pre.code-styler-pre.unwrapped-inactive > code {
|
|
|
|
|
--line-wrapping: pre;
|
|
|
|
|
--line-active-wrapping: pre-wrap;
|
|
|
|
|
}
|
2023-07-08 23:26:11 +00:00
|
|
|
.code-styler pre.code-styler-pre code:not(:has( > input[style*="display: inline;"])):active {
|
|
|
|
|
--line-wrapping: var(--line-active-wrapping) !important;
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
.code-styler pre.code-styler-pre.code-styler-folded > code {
|
2023-08-11 14:01:29 +00:00
|
|
|
max-height: 0 !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-top: 0 !important;
|
|
|
|
|
padding-bottom: 0 !important;
|
|
|
|
|
}
|
|
|
|
|
.code-styler pre.code-styler-pre::before,
|
|
|
|
|
.code-styler pre.code-styler-pre::after {
|
|
|
|
|
content: none !important;
|
|
|
|
|
}
|
|
|
|
|
.markdown-source-view.mod-cm6 .cm-embed-block pre.code-styler-pre {
|
|
|
|
|
margin: 1em 0px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Editing Mode Body */
|
2023-08-25 22:18:18 +00:00
|
|
|
body.code-styler .markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container + [class*="code-styler-line"].HyperMD-codeblock-begin {
|
2023-08-11 14:01:29 +00:00
|
|
|
border-top: none !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
border-top-left-radius: 0px !important;
|
|
|
|
|
border-top-right-radius: 0px !important;
|
|
|
|
|
}
|
|
|
|
|
.code-styler .markdown-source-view [class*="code-styler-line"].HyperMD-codeblock-end {
|
|
|
|
|
border-bottom-left-radius: var(--border-radius);
|
|
|
|
|
border-bottom-right-radius: var(--border-radius);
|
|
|
|
|
}
|
2023-08-25 22:18:18 +00:00
|
|
|
body.code-styler .markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container-hidden + [class*="code-styler-line"].HyperMD-codeblock-begin {
|
2023-07-08 23:26:11 +00:00
|
|
|
border-top-left-radius: var(--border-radius) !important;
|
2023-08-23 23:56:40 +00:00
|
|
|
border-top-right-radius: var(--border-radius) !important
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
body.code-styler .markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container-hidden + [class*="code-styler-line"].HyperMD-codeblock-begin .code-styler-line-number {
|
2023-08-25 22:18:18 +00:00
|
|
|
border-top-left-radius: var(--border-radius) !important;
|
|
|
|
|
}
|
2023-07-08 23:26:11 +00:00
|
|
|
.code-styler .markdown-source-view .HyperMD-codeblock[class*='code-styler-line'] {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
padding: 0 !important;
|
|
|
|
|
padding-left: var(--size-4-4) !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
background: linear-gradient(90deg, var(--gradient-background-colour) var(--gradient-highlights-colour-stop), transparent 100%), var(--code-styler-codeblock-background-colour) !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
.code-styler .markdown-source-view .HyperMD-codeblock[class*='code-styler-line'][class*='language-'] {
|
|
|
|
|
background: linear-gradient(90deg, var(--language-border-colour), var(--language-border-colour) var(--language-border-width), var(--gradient-background-colour) var(--language-border-width) var(--gradient-highlights-colour-stop), transparent 100%), var(--code-styler-codeblock-background-colour) !important;
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler .markdown-source-view .HyperMD-codeblock[class*='code-styler-line'][class*='language-'] .code-styler-line-number {
|
2023-07-08 23:26:11 +00:00
|
|
|
margin-left: var(--language-border-width);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Header styling */
|
2023-08-23 23:56:40 +00:00
|
|
|
body .code-styler-header-container-hidden {
|
2023-07-08 23:26:11 +00:00
|
|
|
display: none !important;
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
.code-styler-header-container {
|
2023-08-11 14:01:29 +00:00
|
|
|
display: flex !important;
|
|
|
|
|
overflow: visible;
|
2023-07-08 23:26:11 +00:00
|
|
|
height: var(--container-height);
|
|
|
|
|
min-height: var(--container-min-height);
|
2023-08-11 14:01:29 +00:00
|
|
|
box-sizing: content-box;
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-top: var(--header-padding);
|
2023-08-11 14:01:29 +00:00
|
|
|
margin-top: 0px !important;
|
|
|
|
|
font-size: var(--header-font-size);
|
2023-07-08 23:26:11 +00:00
|
|
|
transition: border-bottom ease-in-out var(--duration-button);
|
2023-08-11 14:01:29 +00:00
|
|
|
user-select: none;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
.markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container {
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-bottom: var(--header-separator-width);
|
2023-08-11 14:01:29 +00:00
|
|
|
padding-left: var(--language-border-width);
|
2023-07-08 23:26:11 +00:00
|
|
|
border-top: var(--code-styler-header-border);
|
|
|
|
|
border-right: var(--code-styler-header-border);
|
2023-08-11 14:01:29 +00:00
|
|
|
border-left: var(--code-styler-header-border);
|
|
|
|
|
background: linear-gradient(var(--code-styler-header-background-colour) 0%,var(--code-styler-header-background-colour) calc(100% - var(--header-separator-width)), var(--code-styler-header-separator-colour) calc(100% - var(--header-separator-width)), var(--code-styler-header-separator-colour) 100%) var(--language-border-width) bottom/100% border-box no-repeat,var(--language-border-colour) !important;
|
|
|
|
|
border-top-left-radius: var(--border-radius);
|
|
|
|
|
border-top-right-radius: var(--border-radius);
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
pre.code-styler-pre .code-styler-header-container {
|
2023-07-08 23:26:11 +00:00
|
|
|
border-bottom: var(--header-separator-width) solid var(--code-styler-header-separator-colour);
|
2023-08-11 14:01:29 +00:00
|
|
|
background-color: var(--code-styler-header-background-colour);
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
.markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container.code-styler-header-folded {
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-bottom: var(--header-padding);
|
|
|
|
|
border-bottom: var(--code-styler-header-border);
|
2023-08-23 23:56:40 +00:00
|
|
|
border-bottom: var(--folded-bottom-border);
|
2023-08-11 14:01:29 +00:00
|
|
|
background: linear-gradient(var(--code-styler-header-background-colour) 0%,var(--code-styler-header-background-colour) 100%) var(--language-border-width) bottom/100% border-box no-repeat,var(--language-border-colour) !important;
|
|
|
|
|
border-bottom-left-radius: var(--border-radius);
|
|
|
|
|
border-bottom-right-radius: var(--border-radius);
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
pre.code-styler-pre.code-styler-folded .code-styler-header-container {
|
|
|
|
|
border-bottom: var(--folded-bottom-border);
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
.code-styler-header-container .code-styler-header-language-tag {
|
2023-07-08 23:26:11 +00:00
|
|
|
display: flex;
|
|
|
|
|
height: 100%;
|
2023-08-11 14:01:29 +00:00
|
|
|
flex-direction: column;
|
|
|
|
|
align-content: center;
|
|
|
|
|
justify-content: center;
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-top: calc(1em * var(--header-inner-vertical-padding));
|
2023-08-11 14:01:29 +00:00
|
|
|
padding-right: var(--header-spacing);
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-bottom: calc(1em * var(--header-inner-vertical-padding));
|
2023-08-11 14:01:29 +00:00
|
|
|
padding-left: var(--header-spacing);
|
2023-07-08 23:26:11 +00:00
|
|
|
border-radius: var(--border-radius) var(--border-radius) 0px 0px;
|
2023-08-11 14:01:29 +00:00
|
|
|
margin-right: var(--header-spacing);
|
2023-07-08 23:26:11 +00:00
|
|
|
background-color: var(--code-styler-header-language-tag-background-colour);
|
|
|
|
|
color: var(--code-styler-header-language-tag-text-colour);
|
2023-08-11 14:01:29 +00:00
|
|
|
font-size: inherit;
|
2023-07-08 23:26:11 +00:00
|
|
|
font-style: var(--code-styler-header-language-tag-text-italic, normal);
|
2023-08-11 14:01:29 +00:00
|
|
|
font-weight: var(--code-styler-header-language-tag-text-bold, normal);
|
2023-07-08 23:26:11 +00:00
|
|
|
text-align: center;
|
|
|
|
|
transition: border-radius ease-in-out var(--duration-button), padding ease-in-out var(--duration-button);
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
.markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container.code-styler-header-folded .code-styler-header-language-tag,
|
|
|
|
|
pre.code-styler-pre.code-styler-folded .code-styler-header-container .code-styler-header-language-tag {
|
2023-07-08 23:26:11 +00:00
|
|
|
border-radius: var(--border-radius);
|
|
|
|
|
}
|
|
|
|
|
.code-styler-header-text {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2023-08-11 14:01:29 +00:00
|
|
|
align-content: center;
|
|
|
|
|
justify-content: center;
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-top: calc(1em * var(--header-inner-vertical-padding));
|
|
|
|
|
padding-bottom: calc(1em * var(--header-inner-vertical-padding));
|
2023-08-11 14:01:29 +00:00
|
|
|
padding-left: 0px;
|
2023-07-08 23:26:11 +00:00
|
|
|
color: var(--code-styler-header-text-colour);
|
2023-08-11 14:01:29 +00:00
|
|
|
font-size: inherit;
|
2023-07-08 23:26:11 +00:00
|
|
|
font-style: var(--code-styler-header-title-text-italic, normal);
|
2023-08-11 14:01:29 +00:00
|
|
|
font-weight: var(--code-styler-header-title-text-bold, normal);
|
2023-07-08 23:26:11 +00:00
|
|
|
transition: padding ease-in-out var(--duration-button);
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
body .code-styler-header-container:not(:has( div > img.code-styler-icon)) .code-styler-header-language-tag {
|
2023-07-08 23:26:11 +00:00
|
|
|
border-bottom-left-radius: 0 !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
border-top-left-radius: 0 !important;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
body .code-styler-header-container:not(:has( .code-styler-header-language-tag)) .code-styler-header-text {
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-left: var(--header-spacing);
|
|
|
|
|
}
|
|
|
|
|
div:has(> img.code-styler-icon) {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
flex-direction: column;
|
2023-08-11 14:01:29 +00:00
|
|
|
align-content: center;
|
|
|
|
|
justify-content: center;
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-top: calc(1em * var(--header-inner-vertical-padding));
|
2023-08-11 14:01:29 +00:00
|
|
|
padding-right: var(--header-spacing);
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-bottom: calc(1em * var(--header-inner-vertical-padding));
|
|
|
|
|
padding-left: var(--header-spacing);
|
|
|
|
|
transition: padding ease-in-out var(--duration-button);
|
|
|
|
|
}
|
|
|
|
|
.code-styler-icon {
|
|
|
|
|
width: var(--language-icon-size);
|
|
|
|
|
height: var(--language-icon-size);
|
|
|
|
|
border: none !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
margin: 0 !important;
|
|
|
|
|
filter: var(--language-icon-filter);
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Lines */
|
|
|
|
|
pre.code-styler-pre [class^='code-styler-line-highlighted'] > .code-styler-line-text {
|
|
|
|
|
background-image: linear-gradient(90deg, var(--gradient-background-colour) 0% var(--gradient-highlights-colour-stop), var(--code-styler-codeblock-background-colour) 100%);
|
|
|
|
|
}
|
|
|
|
|
.code-styler-line-highlighted {
|
|
|
|
|
--gradient-background-colour: var(--code-styler-default-highlight-colour) !important;
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
/*! Complicated */
|
2023-07-08 23:26:11 +00:00
|
|
|
.code-styler-active-line-highlight .cm-active,
|
|
|
|
|
.code-styler-active-line-highlight-editor .cm-active {
|
|
|
|
|
background: linear-gradient(to right, var(--code-styler-active-editor-line-colour), var(--gradient-highlights-colour-stop), transparent) !important;
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
/*! Complicated */
|
2023-08-16 13:27:05 +00:00
|
|
|
.code-styler-active-line-highlight .markdown-source-view .HyperMD-codeblock.cm-active,
|
|
|
|
|
.code-styler-active-line-highlight-codeblock .markdown-source-view .HyperMD-codeblock.cm-active {
|
2023-07-08 23:26:11 +00:00
|
|
|
background: linear-gradient(to right, var(--code-styler-active-codeblock-line-colour), var(--gradient-highlights-colour-stop), var(--code-styler-codeblock-background-colour)) !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Line numbers */
|
2023-08-27 08:11:54 +00:00
|
|
|
.markdown-source-view :not(div):not([class*="HyperMD-codeblock"]) > .code-styler-line-number {
|
2023-07-08 23:26:11 +00:00
|
|
|
display: none;
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler code > div:first-child > .code-styler-line-number { /*? Maintain gutter colour when padded */
|
2023-07-08 23:26:11 +00:00
|
|
|
box-shadow: 0px calc(-1 * var(--code-padding)) var(--code-styler-gutter-background-colour);
|
|
|
|
|
transition: box-shadow ease-in-out var(--duration-button);
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler .code-styler-folded > code > div:first-child > .code-styler-line-number { /*? Maintain gutter colour when padded */
|
2023-07-08 23:26:11 +00:00
|
|
|
box-shadow: 0px 0px var(--code-styler-gutter-background-colour);
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler code > div:last-child > .code-styler-line-number { /*? Maintain gutter colour when padded */
|
2023-07-08 23:26:11 +00:00
|
|
|
box-shadow: 0px var(--code-padding) var(--code-styler-gutter-background-colour);
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler code > div:only-child > .code-styler-line-number { /*? Maintain gutter colour when padded */
|
2023-07-08 23:26:11 +00:00
|
|
|
box-shadow: 0px calc(-1 * var(--code-padding)) var(--code-styler-gutter-background-colour),0px var(--code-padding) var(--code-styler-gutter-background-colour);
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
pre.code-styler-pre div > [class*='code-styler-line-number'],
|
|
|
|
|
.markdown-source-view div[class*="HyperMD-codeblock"] > [class*='code-styler-line-number'] {
|
2023-07-08 23:26:11 +00:00
|
|
|
min-width: var(--line-number-gutter-min-width);
|
2023-08-11 14:01:29 +00:00
|
|
|
padding-right: 8px;
|
|
|
|
|
padding-left: calc(4px + var(--language-border-width));
|
2023-07-08 23:26:11 +00:00
|
|
|
background-color: var(--code-styler-gutter-background-colour);
|
|
|
|
|
color: var(--code-styler-gutter-text-colour);
|
2023-08-11 14:01:29 +00:00
|
|
|
font-family: var(--font-monospace);
|
|
|
|
|
font-size: var(--code-size);
|
|
|
|
|
text-align: right;
|
2023-07-08 23:26:11 +00:00
|
|
|
user-select: none;
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.markdown-source-view [class*="HyperMD-codeblock"] > .code-styler-line-number {
|
2023-07-08 23:26:11 +00:00
|
|
|
position: absolute;
|
2023-08-11 14:01:29 +00:00
|
|
|
left: 0;
|
2023-07-08 23:26:11 +00:00
|
|
|
display: inline-block;
|
|
|
|
|
min-width: calc(var(--line-number-gutter-min-width) - 12px);
|
2023-08-11 14:01:29 +00:00
|
|
|
height: 100%;
|
|
|
|
|
box-sizing: content-box;
|
|
|
|
|
padding-top: var(--line-number-height-correction);
|
2023-07-08 23:26:11 +00:00
|
|
|
direction: rtl;
|
2023-08-11 14:01:29 +00:00
|
|
|
overflow-x: auto;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
.markdown-source-view .HyperMD-codeblock-begin .code-styler-line-number,
|
2023-08-27 08:11:54 +00:00
|
|
|
.markdown-source-view .HyperMD-codeblock-end .code-styler-line-number {
|
2023-07-08 23:26:11 +00:00
|
|
|
width: var(--line-number-gutter-width);
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
pre.code-styler-pre .code-styler-line-number {
|
2023-07-08 23:26:11 +00:00
|
|
|
position: sticky;
|
|
|
|
|
top: -1px;
|
|
|
|
|
left: 0;
|
|
|
|
|
border-top: var(--line-number-height-correction) solid transparent;
|
2023-08-11 14:01:29 +00:00
|
|
|
grid-column: 1;
|
|
|
|
|
white-space: nowrap;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
pre.code-styler-pre div:last-child > .code-styler-line-number {
|
2023-07-08 23:26:11 +00:00
|
|
|
width: unset;
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler-gutter-highlight pre.code-styler-pre [class*="code-styler-line-highlighted"] .code-styler-line-number {
|
2023-07-08 23:26:11 +00:00
|
|
|
background-color: var(--gradient-background-colour);
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler-active-line-highlight.code-styler-gutter-highlight .markdown-source-view .HyperMD-codeblock[class*="code-styler-line"].cm-active .code-styler-line-number,
|
|
|
|
|
.code-styler-active-line-highlight-codeblock.code-styler-gutter-highlight .markdown-source-view .HyperMD-codeblock[class*="code-styler-line"].cm-active .code-styler-line-number,
|
|
|
|
|
.code-styler-gutter-highlight [class*="code-styler-line-highlighted"] .code-styler-line-number {
|
2023-07-08 23:26:11 +00:00
|
|
|
background-color: rgba(0,0,0,0);
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler-gutter-active-line .cm-active .code-styler-line-number{
|
2023-07-08 23:26:11 +00:00
|
|
|
color: var(--code-styler-gutter-active-text-colour);
|
|
|
|
|
}
|
2023-08-27 08:11:54 +00:00
|
|
|
.code-styler .markdown-source-view .HyperMD-codeblock:has(.code-styler-line-number) {
|
2023-07-08 23:26:11 +00:00
|
|
|
padding-left: calc(12px + var(--language-border-width) + var(--line-number-gutter-width) + var(--line-number-gutter-padding)) !important;
|
|
|
|
|
}
|
|
|
|
|
.code-styler .markdown-source-view .HyperMD-codeblock[class*='code-styler-line']::before {
|
|
|
|
|
content: none !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Line text */
|
|
|
|
|
pre.code-styler-pre > code > div[class*='code-styler-line'] {
|
|
|
|
|
display: contents !important;
|
|
|
|
|
}
|
|
|
|
|
pre.code-styler-pre .code-styler-line-text {
|
|
|
|
|
flex-basis: 100%;
|
|
|
|
|
padding-left: var(--line-number-gutter-padding);
|
|
|
|
|
grid-column: 2;
|
|
|
|
|
}
|
|
|
|
|
.HyperMD-codeblock:has(> .cm-widgetBuffer) { /*? Prevent Line Wraps */
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
.HyperMD-codeblock:has(> .cm-widgetBuffer) > .cm-hmd-codeblock { /*? Prevent Line Wraps */
|
|
|
|
|
white-space: break-spaces;
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-08 08:29:10 +00:00
|
|
|
/** Scroll Bar */
|
2023-08-23 23:56:40 +00:00
|
|
|
pre.code-styler-pre.code-styler-folded::-webkit-scrollbar,
|
|
|
|
|
pre.code-styler-pre.code-styler-folded code::-webkit-scrollbar,
|
2023-08-16 13:27:05 +00:00
|
|
|
pre.code-styler-pre.hide-scroll::-webkit-scrollbar,
|
|
|
|
|
pre.code-styler-pre.hide-scroll code::-webkit-scrollbar {
|
|
|
|
|
display: none !important;
|
2023-08-09 08:14:40 +00:00
|
|
|
}
|
|
|
|
|
|
2023-07-08 23:26:11 +00:00
|
|
|
/** Buttons */
|
|
|
|
|
@keyframes outdent {
|
|
|
|
|
from {
|
|
|
|
|
margin-right: calc(var(--copy-code-header-right-margin) - var(--dent-difference));
|
|
|
|
|
clip-path: var(--polygon-in);
|
|
|
|
|
}
|
|
|
|
|
to {
|
|
|
|
|
margin-right: var(--copy-code-header-right-margin);
|
|
|
|
|
clip-path: var(--polygon-out);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@keyframes indent {
|
|
|
|
|
from {
|
|
|
|
|
margin-right: var(--copy-code-header-right-margin);
|
|
|
|
|
clip-path: var(--polygon-out);
|
|
|
|
|
}
|
|
|
|
|
to {
|
|
|
|
|
margin-right: calc(var(--copy-code-header-right-margin) - var(--dent-difference));
|
|
|
|
|
clip-path: var(--polygon-in);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@keyframes reverse-outdent {
|
|
|
|
|
from {
|
|
|
|
|
clip-path: var(--polygon-in);
|
|
|
|
|
}
|
|
|
|
|
to {
|
|
|
|
|
clip-path: var(--polygon-out);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@keyframes reverse-indent {
|
|
|
|
|
from {
|
|
|
|
|
clip-path: var(--polygon-out);
|
|
|
|
|
}
|
|
|
|
|
to {
|
|
|
|
|
clip-path: var(--polygon-in);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.markdown-rendered pre.code-styler-pre button {
|
|
|
|
|
display: unset !important;
|
|
|
|
|
padding: 0 !important;
|
|
|
|
|
border: none !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
margin: 0;
|
2023-07-08 23:26:11 +00:00
|
|
|
margin-top: 0 !important;
|
|
|
|
|
margin-bottom: 0 !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
background: transparent !important;
|
|
|
|
|
box-shadow: none;
|
|
|
|
|
color: var(--code-styler-button-colour) !important;
|
|
|
|
|
font-family: var(--font-interface);
|
|
|
|
|
font-size: var(--font-ui-smaller);
|
|
|
|
|
opacity: 1;
|
|
|
|
|
transition: visibility var(--duration-button), opacity var(--duration-button);
|
|
|
|
|
visibility: visible;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
pre.code-styler-pre.code-styler-folded button,
|
|
|
|
|
pre.code-styler-pre:not(.code-styler-folded):not(:hover) button,
|
|
|
|
|
pre.code-styler-pre:not(.code-styler-folded):not(:hover) .code-styler-header-container::after {
|
2023-08-11 14:01:29 +00:00
|
|
|
opacity: 0;
|
|
|
|
|
visibility: hidden
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
.code-styler-header-container::after {
|
2023-07-08 23:26:11 +00:00
|
|
|
position: relative;
|
|
|
|
|
top: 0;
|
2023-08-11 14:01:29 +00:00
|
|
|
right: 0;
|
2023-07-08 23:26:11 +00:00
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
2023-08-11 14:01:29 +00:00
|
|
|
margin: auto;
|
|
|
|
|
margin-right: var(--header-button-spacing);
|
2023-07-08 23:26:11 +00:00
|
|
|
background-color: var(--code-styler-button-colour);
|
2023-08-11 14:01:29 +00:00
|
|
|
content: "\200b";
|
2023-07-08 23:26:11 +00:00
|
|
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' xml:space='preserve'%3E%3Cpath d='M16 22 6 12l1.4-1.4 8.6 8.6 8.6-8.6L26 12z'/%3E%3Cpath fill='none' d='M0 0h32v32H0z'/%3E%3C/svg%3E");
|
|
|
|
|
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
|
2023-08-11 14:01:29 +00:00
|
|
|
-webkit-mask-repeat: no-repeat;
|
2023-07-08 23:26:11 +00:00
|
|
|
mask-repeat: no-repeat;
|
|
|
|
|
opacity: 1;
|
|
|
|
|
scale: 0.8;
|
|
|
|
|
transition: transform var(--duration-button) ease-out, visibility var(--duration-button), opacity var(--duration-button), scale var(--duration-button) cubic-bezier(0.4, 0.14, 0.3, 1);
|
2023-08-11 14:01:29 +00:00
|
|
|
visibility: visible;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
pre.code-styler-pre.code-styler-folded .code-styler-header-container::after,
|
|
|
|
|
.markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container:not(:has(+ .HyperMD-codeblock-begin))::after {
|
2023-07-08 23:26:11 +00:00
|
|
|
transform: rotate(-90deg);
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
.code-styler-header-container:hover::after {
|
2023-07-08 23:26:11 +00:00
|
|
|
scale: 1;
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
body pre.code-styler-pre:has(.code-styler-header-container-hidden) button.copy-code-button,
|
|
|
|
|
body .markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container-hidden + .HyperMD-codeblock-begin span.code-block-flair {
|
2023-07-08 23:26:11 +00:00
|
|
|
top: calc(0.5 * var(--font-text-size) * 0.875 * var(--line-height-normal)) !important;
|
|
|
|
|
--copy-code-header-right-margin: 12px;
|
|
|
|
|
}
|
2023-08-23 23:56:40 +00:00
|
|
|
body .markdown-source-view :not(pre.code-styler-pre) > .code-styler-header-container.hidden + .HyperMD-codeblock-begin {
|
2023-07-08 23:26:11 +00:00
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
pre.code-styler-pre button.copy-code-button {
|
|
|
|
|
top: max(calc(0.5 * var(--container-height) * 1),calc(0.5 * var(--container-min-height) * 1)) !important;
|
|
|
|
|
bottom: unset !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
transform: translateY(-50%);
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
pre.code-styler-pre button.copy-code-button,
|
|
|
|
|
pre.code-styler-pre button.run-code-button, /*? Execute Code Plugin Compatibility */
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair {
|
|
|
|
|
margin-right: calc(var(--copy-code-header-right-margin) - var(--dent-difference));
|
|
|
|
|
clip-path: var(--polygon-in);
|
2023-08-11 14:01:29 +00:00
|
|
|
will-change: margin-right, clip-path;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
pre.code-styler-pre button.copy-code-button:not(:active),
|
|
|
|
|
pre.code-styler-pre button.run-code-button:not(:active), /*? Execute Code Plugin Compatibility */
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair:not(:active) {
|
|
|
|
|
animation: indent var(--duration-button);
|
|
|
|
|
}
|
|
|
|
|
pre.code-styler-pre button.copy-code-button:hover,
|
|
|
|
|
pre.code-styler-pre button.run-code-button:hover, /*? Execute Code Plugin Compatibility */
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair:hover{
|
|
|
|
|
margin-right: var(--copy-code-header-right-margin);
|
2023-08-11 14:01:29 +00:00
|
|
|
animation: outdent var(--duration-button);
|
|
|
|
|
background-color: transparent;
|
2023-07-08 23:26:11 +00:00
|
|
|
clip-path: var(--polygon-out);
|
|
|
|
|
}
|
|
|
|
|
pre.code-styler-pre button.copy-code-button:active,
|
|
|
|
|
pre.code-styler-pre button.run-code-button:active, /*? Execute Code Plugin Compatibility */
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair:active {
|
|
|
|
|
scale: 0.95;
|
|
|
|
|
transition: scale var(--duration-button) cubic-bezier(0.4, 0.14, 0.3, 1);
|
|
|
|
|
}
|
|
|
|
|
pre.code-styler-pre button.copy-code-button::before,
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair::before {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 14px;
|
|
|
|
|
height: 14px;
|
|
|
|
|
padding-right: 4px;
|
|
|
|
|
background-color: var(--code-styler-button-colour);
|
2023-08-11 14:01:29 +00:00
|
|
|
content: "\200b";
|
2023-07-08 23:26:11 +00:00
|
|
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z'/%3E%3Cpath d='M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z'/%3E%3Cpath fill='none' d='M0 0h32v32H0z' data-name='<Transparent Rectangle>'/%3E%3C/svg%3E");
|
|
|
|
|
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z'/%3E%3Cpath d='M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z'/%3E%3Cpath fill='none' d='M0 0h32v32H0z' data-name='<Transparent Rectangle>'/%3E%3C/svg%3E");
|
2023-08-11 14:01:29 +00:00
|
|
|
-webkit-mask-repeat: no-repeat;
|
2023-07-08 23:26:11 +00:00
|
|
|
mask-repeat: no-repeat;
|
|
|
|
|
vertical-align: 1px;
|
|
|
|
|
}
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair {
|
2023-08-11 14:01:29 +00:00
|
|
|
position: absolute;
|
2023-07-08 23:26:11 +00:00
|
|
|
top: min(calc(-0.5 * var(--container-height) * 1.1 - var(--header-separator-width)),calc(-0.5 * var(--container-min-height) * 1.1 - var(--header-separator-width))) !important;
|
|
|
|
|
right: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
margin-top: 0 !important;
|
|
|
|
|
margin-bottom: 0 !important;
|
2023-08-11 14:01:29 +00:00
|
|
|
font-size: 0;
|
|
|
|
|
line-height: initial !important;
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
visibility: hidden;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair > * {
|
|
|
|
|
width: 0px;
|
|
|
|
|
}
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair::before {
|
2023-08-11 14:01:29 +00:00
|
|
|
font-size: var(--font-ui-smaller);
|
2023-07-08 23:26:11 +00:00
|
|
|
opacity: 1;
|
|
|
|
|
vertical-align: -1px;
|
2023-08-11 14:01:29 +00:00
|
|
|
visibility: visible;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock.code-styler-line span.code-block-flair::after {
|
|
|
|
|
color: var(--code-styler-button-colour);
|
2023-08-11 14:01:29 +00:00
|
|
|
content: 'Copy';
|
|
|
|
|
font-size: var(--font-ui-smaller);
|
|
|
|
|
opacity: 1;
|
|
|
|
|
visibility: visible;
|
2023-07-08 23:26:11 +00:00
|
|
|
}
|
|
|
|
|
.markdown-source-view.mod-cm6 .HyperMD-codeblock-begin.code-styler-line {
|
|
|
|
|
overflow: visible;
|
|
|
|
|
}
|