Skip to content
Snippets Groups Projects
Commit 21a72315 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

showcase: Fix syntax highlighting

Include the highlight.js css in all activities and move the
code css into the app, so it's defined where it is used.
parent ef487845
No related branches found
No related tags found
1 merge request!47showcase: Fix syntax highlighting
Pipeline #25363 passed
...@@ -55,15 +55,6 @@ export function getGeneralCSS(doMarginPaddingReset = true) { ...@@ -55,15 +55,6 @@ export function getGeneralCSS(doMarginPaddingReset = true) {
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
} }
code {
background-color: var(--dbp-light);
color: var(--dbp-danger-bg-color);
font-size: 1em;
line-height: 1.5em;
font-weight: normal;
padding: 0.25em 0.5em 0.25em;
}
.field:not(:last-child) { .field:not(:last-child) {
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
} }
......
import {css, CSSResult} from 'lit-element'; import {css, CSSResult, unsafeCSS} from 'lit-element';
import * as commonUtils from '@dbp-toolkit/common/utils';
import highlightCSSPath from 'highlight.js/styles/github.css';
/** /**
* We want to have "neutral" colors here * We want to have "neutral" colors here
...@@ -8,6 +10,8 @@ import {css, CSSResult} from 'lit-element'; ...@@ -8,6 +10,8 @@ import {css, CSSResult} from 'lit-element';
export function getDemoCSS() { export function getDemoCSS() {
// language=css // language=css
return css` return css`
@import url("${unsafeCSS(commonUtils.getAssetURL(highlightCSSPath))}");
h1.title {margin-bottom: 1em;} h1.title {margin-bottom: 1em;}
div.container {margin-bottom: 1.5em;} div.container {margin-bottom: 1.5em;}
h1, h2, h3, h4 { h1, h2, h3, h4 {
...@@ -71,5 +75,19 @@ export function getDemoCSS() { ...@@ -71,5 +75,19 @@ export function getDemoCSS() {
-webkit-filter: invert(0%); -webkit-filter: invert(0%);
} }
} }
pre {
background-color: var(--dbp-light);
padding: 0.4em;
overflow-x: auto;
border: 1px solid #ddd;
}
code {
background-color: var(--dbp-light);
line-height: 1.5em;
font-weight: normal;
padding: 0.25em 0.5em 0.25em;
}
`; `;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment