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:
@@ -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';
|
||||
|
||||
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user