Skip to content

Commit

Permalink
chore: improve css import
Browse files Browse the repository at this point in the history
- 公共样式放入顶层
- 合并 `<style>`
  • Loading branch information
YangFong committed Aug 26, 2023
1 parent 8e26697 commit 2c9f31e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
10 changes: 2 additions & 8 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,11 @@ import CodemirrorEditor from '@/views/CodemirrorEditor.vue'
html,
body,
#app {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
</style>

<style lang="less">
/* 每个页面公共css */
@import url('./assets/less/style-mirror.css');
@import url('./assets/less/theme.less');
::-webkit-scrollbar {
width: 6px;
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import 'element-ui/lib/theme-chalk/index.css'
import 'codemirror/lib/codemirror.css'
import 'codemirror/theme/xq-light.css'

/* 每个页面公共css */
import './assets/less/app.less'
import './assets/less/theme.less'
import './assets/less/style-mirror.less'

import 'codemirror/mode/css/css'
import 'codemirror/mode/markdown/markdown'
import 'codemirror/addon/edit/closebrackets'
Expand Down
6 changes: 0 additions & 6 deletions src/views/CodemirrorEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,7 @@ export default {
.editor__header {
padding: 0;
}
</style>
<style lang="less" scoped>
.main-body {
padding-top: 12px;
overflow: hidden;
Expand Down Expand Up @@ -699,7 +697,3 @@ export default {
overflow-x: auto;
}
</style>

<style lang="less" scoped>
@import url('../assets/less/app.less');
</style>

0 comments on commit 2c9f31e

Please sign in to comment.