1
1
Fork 1
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-11 12:06:08 +02:00

Fix CSS specificity issue with easymde's css (#18201)

* Fix CSS specificity issue with easymde's css

PR #18069 introduced a regression in certain overwritten editor styles
because the dynamic loading of easymde.min.css causes its's style to
apply after our supposed override styles.

Solve this by bundling the styles into index.css. We should later aim to
completely replace easymde.min.css completely with our own styles so there
are no more conflicts.

* Update web_src/js/features/comp/EasyMDE.js

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind 2022-01-07 00:41:31 -08:00 committed by GitHub
parent 80705cf4b4
commit 3dbdf36d95
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -25,10 +25,10 @@ export async function importEasyMDE() {
// https://github.com/codemirror/CodeMirror/issues/5484
// https://github.com/codemirror/CodeMirror/issues/4838
// EasyMDE's CSS should be loaded via webpack config, otherwise our own styles can not overwrite the default styles.
const [{default: EasyMDE}, {default: CodeMirror}] = await Promise.all([
import(/* webpackChunkName: "easymde" */'easymde'),
import(/* webpackChunkName: "codemirror" */'codemirror'),
import(/* webpackChunkName: "easymde" */'easymde/dist/easymde.min.css'),
]);
// CodeMirror plugins must be loaded by a "Plain browser env"

View File

@ -46,6 +46,7 @@ export default {
resolve(__dirname, 'web_src/js/jquery.js'),
resolve(__dirname, 'web_src/fomantic/build/semantic.js'),
resolve(__dirname, 'web_src/js/index.js'),
resolve(__dirname, 'node_modules/easymde/dist/easymde.min.css'),
resolve(__dirname, 'web_src/fomantic/build/semantic.css'),
resolve(__dirname, 'web_src/less/misc.css'),
resolve(__dirname, 'web_src/less/index.less'),