Skip to content

Commit 3dbdf36

Browse files
silverwindlunnywxiaoguang
authored
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>
1 parent 80705cf commit 3dbdf36

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

web_src/js/features/comp/EasyMDE.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export async function importEasyMDE() {
2525
// https://github.com/codemirror/CodeMirror/issues/5484
2626
// https://github.com/codemirror/CodeMirror/issues/4838
2727

28+
// EasyMDE's CSS should be loaded via webpack config, otherwise our own styles can not overwrite the default styles.
2829
const [{default: EasyMDE}, {default: CodeMirror}] = await Promise.all([
2930
import(/* webpackChunkName: "easymde" */'easymde'),
3031
import(/* webpackChunkName: "codemirror" */'codemirror'),
31-
import(/* webpackChunkName: "easymde" */'easymde/dist/easymde.min.css'),
3232
]);
3333

3434
// CodeMirror plugins must be loaded by a "Plain browser env"

webpack.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export default {
4646
resolve(__dirname, 'web_src/js/jquery.js'),
4747
resolve(__dirname, 'web_src/fomantic/build/semantic.js'),
4848
resolve(__dirname, 'web_src/js/index.js'),
49+
resolve(__dirname, 'node_modules/easymde/dist/easymde.min.css'),
4950
resolve(__dirname, 'web_src/fomantic/build/semantic.css'),
5051
resolve(__dirname, 'web_src/less/misc.css'),
5152
resolve(__dirname, 'web_src/less/index.less'),

0 commit comments

Comments
 (0)