1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

Optimize markdown code (#5860)

* optimize markdown editor css

* optimize markdown viewer

* optimize markdown viewer

* fix wraning
This commit is contained in:
杨顺强
2023-12-26 14:35:44 +08:00
committed by GitHub
parent 97ea8593c3
commit 4a27e72c69
15 changed files with 152 additions and 789 deletions

View File

@@ -0,0 +1,84 @@
html, body, #root {
width: 100%;
height: 100%;
}
#root {
display: flex;
flex-direction: column;
min-height: 0;
min-width: 0;
}
.sf-md-viewer-topbar-first,
.sf-md-viewer-topbar-first-narrow {
padding: 4px 10px;
background-color: #fff;
border-bottom: 1px solid #e5e5e5;
box-shadow: 0 3px 2px -2px rgba(200,200,200,.15);
flex-shrink:0;
align-items: center;
}
@media (max-width: 768px) {
.sf-md-viewer-topbar-first {
display: none !important;
}
}
@media (min-width: 768px) {
.sf-md-viewer-topbar-first-narrow {
display: none !important;
}
}
/* toolbar */
.topbar-file-info {
display: inline-block;
margin-left: 8px;
/*
only select file info text
*/
user-select: text;
}
.topbar-file-info .file-title {
font-size: 1.2rem;
font-weight: bold;
display: flex;
align-items: center;
}
.topbar-file-info .file-title .iconfont {
font-size: 0.875rem;
}
.topbar-file-info .file-title .file-star {
font-size: 0.875rem;
cursor: pointer;
margin-left: 0.5rem;
vertical-align: text-bottom;
color: #999;
}
.topbar-file-info .file-title .file-star .star {
color: #999;
}
.topbar-file-info .file-state {
font-size: 0.8125rem;
}
.topbar-file-info .file-state .file-modifier-name {
margin-right: 0.5rem;
}
.topbar-file-info .file-state .file-modifier-savedraft {
margin-left: 0.5rem;
color: #888;
}
.sf-md-viewer-content {
flex: 1;
display: flex;
min-height: 0;
min-width: 0;
}

View File

@@ -1,125 +0,0 @@
.seafile-markdown-editor {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
min-width: 0;
}
.seafile-markdown-editor .markdown-editor-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
border-bottom: 1px solid #e5e5e5;
background-color: #fff;
user-select: none;
box-shadow: 0 3px 2px -2px rgba(200,200,200,.15);
z-index: 3;
}
.seafile-markdown-editor .markdown-editor-toolbar .editor-btn-group {
height: 100%;
padding: 5px 0 5px 5px;
font-size: 0.75rem;
border-right: 1px solid #e5e5e5;
color: #555555;
}
.seafile-markdown-editor .markdown-editor-content {
flex: 1;
display: flex;
min-height: 0;
min-width: 0;
overflow: hidden;
}
.seafile-markdown-editor .markdown-editor-content .markdown-editor-wrapper {
flex: 1;
display: flex;
position: relative;
overflow-x: hidden;
min-height: 0;
min-width: 0;
background-color: #fafaf9;
}
.seafile-markdown-editor .markdown-editor-content .markdown-help-wrapper {
width: 0;
display: flex;
overflow: hidden;
min-width: 0;
min-height: 0;
}
.seafile-markdown-editor .markdown-editor-content .markdown-help-wrapper.show {
width: 300px;
background-color: #fff;
border-left: 1px solid #e6e6dd;
position: relative;
}
.seafile-markdown-editor .markdown-editor-content .markdown-help-wrapper .file-info {
flex: 1;
display: flex;
min-width: 0;
min-height: 0;
}
.seafile-markdown-editor .markdown-editor-content .markdown-help-wrapper .help-info {
flex: 1;
display: flex;
min-width: 0;
min-height: 0;
}
.seafile-markdown-editor ::-webkit-scrollbar{
width: 8px;
height: 8px;
}
.seafile-markdown-editor ::-webkit-scrollbar-button {
display: none;
}
.seafile-markdown-editor ::-webkit-scrollbar-thumb {
background-color: rgb(206, 206, 212);
border-radius: 10px;
}
@media (max-width: 991.8px) {
.seafile-editor {
min-width: calc(100% - 40px);
}
.seafile-editor-main-panel {
width: calc(100% - 200px);
}
.seafile-editor-side-panel {
min-width: 200px;
}
.editor-container {
width: 100%;
}
.editor-container .editor {
margin: 20px !important;
padding: 20px 30px;
}
}
@media (max-width: 768px) {
.editor-container .editor {
margin: 0 !important;
padding: 10px 15px;
border: 0;
}
}
.full-screen .editor-container .article {
margin: 20px auto;
max-width: 950px;
}

View File

@@ -1,89 +0,0 @@
.seafile-markdown-editor .markdown-help-wrapper .side-panel {
flex: 1;
display: flex;
flex-direction: column;
background-color: #f5f5f5;
user-select: none;
}
.seafile-markdown-editor .side-panel .nav {
padding: 10px 0;
min-width: 125px;
border-bottom: 1px solid #eee;
height: 36px;
flex-wrap: nowrap;
}
.seafile-markdown-editor .side-panel .nav .nav-item {
padding: 0 0.75rem;
}
.seafile-markdown-editor .side-panel .nav .nav-link {
padding: 0 0.75rem;
transition: 0.3s color;
margin-right: 0;
}
.seafile-markdown-editor .side-panel .nav-link {
color: #888;
}
.seafile-markdown-editor .side-panel .nav .nav-link.active {
color: #ff9800;
border-bottom: 0;
}
.seafile-markdown-editor .side-panel .nav .iconfont {
font-weight: 700;
font-size: 0.875rem;
}
.seafile-markdown-editor .side-panel-content {
font-size: 0.937rem;
overflow: hidden;
}
.seafile-markdown-editor .side-panel-content:hover {
overflow: auto;
}
.image-view {
width: 200px;
height: 150px;
position: absolute;
background-color: #fff;
z-index: 1004;
box-shadow: 0 0 10px #aaa;
border-radius: 3px;
line-height: 150px;
overflow: hidden;
font-size: 0;
text-align: center;
}
.image-view img {
max-width: 100%;
max-height: 100%;
}
.image-view i {
width: 100%;
height: 100%;
text-align: center;
line-height: 150px;
font-size: 30px;
color: #eb8205;
-moz-animation: rotate 1.5s ease infinite;
-webkit-animation: rotate 1.5s ease infinite;
animation: rotate 1.5s ease infinite;
}
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}