Enable strict CSP support for ACE

With these changes, ACE no longer requires custom inline styles, removing one further dependency from our CSP style list.
This commit is contained in:
Sebastian Serth
2024-04-13 18:28:41 +02:00
committed by Sebastian Serth
parent 3bfce7f1cb
commit 7b769a7673
2 changed files with 7 additions and 0 deletions

View File

@ -85,4 +85,5 @@ import "ace-builds/webpack-resolver"; // Enable webpack resolver, requires `file
// Enable ACE editor extensions. See https://github.com/ajaxorg/ace/wiki/Extensions
import "ace-builds/src-noconflict/ext-language_tools"; // Enable autocompletion
import "ace-builds/src-noconflict/ext-modelist"; // Enable language mode detection
ace.config.set("useStrictCSP", true); // Enable strict CSP mode
window.ace = ace; // Publish ace in global namespace

View File

@ -12,6 +12,12 @@ $web-font-path: '//';
@import '~bootstrap/scss/bootstrap';
@import '~bootswatch/dist/yeti/bootswatch';
// Import the Ace editor styles
@import url('~ace-builds/css/ace.css');
@import url('~ace-builds/css/theme/tomorrow.css');
@import url('~ace-builds/css/theme/tomorrow_night.css');
// We define our own button style here, since `btn-outline-dark` and `btn-outline-light` do not switch colors.
html[data-bs-theme="dark"] {
.btn-outline-contrast {