1
0
mirror of https://github.com/pyscript/pyscript.git synced 2022-05-01 19:47:48 +03:00

added error class to the errorElement in base.ts

This commit is contained in:
Princiya Sequeira
2022-04-25 19:45:23 +02:00
parent 0d3d64eab9
commit 2f7d948074
2 changed files with 6 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { componentDetailsNavOpen, loadedEnvironments, mode, pyodideLoaded } from '../stores';
import { guidGenerator } from '../utils';
import { guidGenerator, addClasses } from '../utils';
// Premise used to connect to the first available pyodide interpreter
let pyodideReadyPromise;
let environments;
@@ -144,6 +144,9 @@ export class BaseEvalElement extends HTMLElement {
Element = pyodide.globals.get('Element');
}
const out = Element(this.errorElement.id);
addClasses(this.errorElement, ['bg-red-200', 'p-2']);
// @ts-ignore
out.write.callKwargs(err, { append : true});
this.errorElement.hidden = false;
this.errorElement.style.display = 'block';

View File

@@ -77,7 +77,7 @@ export class PyRepl extends BaseEvalElement {
// })
];
const customTheme = EditorView.theme({
'.cm-focused .cm-editor, .cm-editor ::selection': { outline: '0px' },
'&.cm-focused .cm-editor': { outline: '0px' },
'.cm-scroller': { lineHeight: 2.5 },
'.cm-activeLine': { backgroundColor: '#fff' },
'.cm-content': { padding: 0, backgroundColor: '#f5f5f5' },