Color modes (#1181)

This commit is contained in:
Liyas Thomas
2020-09-24 08:22:54 +05:30
committed by GitHub
parent 91677a41d4
commit e94fdcad32
33 changed files with 239 additions and 464 deletions

View File

@@ -19,8 +19,6 @@
</style>
<script>
const DEFAULT_THEME = "twilight"
import ace from "ace-builds"
import "ace-builds/webpack-resolver"
import jsonParse from "~/helpers/jsonParse"
@@ -106,7 +104,10 @@ export default {
if (this.theme) {
return this.theme
}
return this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME
const strip = (str) => str.replace(/#/g, "").replace(/ /g, "").replace(/"/g, "")
return strip(
window.getComputedStyle(document.documentElement).getPropertyValue("--editor-theme")
)
},
provideLinting: debounce(function (code) {