Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions components/common/editor/editor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/*
* Markdown editor: GitHub's comment editor, written once for every place Forgejo renders its own
* markdown editor: a bordered box whose toolbar carries the Write/Preview tabs, and a plain
* attachment line instead of a dashed drop area. To style another editor, add its container to
* the list. The release form keeps Forgejo's drop area and only takes the editor.
*/
:is(
.page-content.repository.view.issue.github-conversation .comment.form,
.page-content.repository.new.issue.github-issue-new,
.review-box-panel,
.comment-code-cloud,
.page-content.repository.new.release
)
.combo-markdown-editor {
border: 1px solid var(--color-light-border);
border-radius: var(--border-radius);
background: var(--color-body);
& markdown-toolbar {
background: var(--color-box-header);
border-bottom: 1px solid var(--color-light-border);
}
& .markdown-toolbar-button {
color: var(--color-text-light-1);
width: 28px;
height: 28px;
padding: 6px;
border: 0;
background: transparent;
}
& textarea {
background: var(--color-body);
font-size: 14px;
border: 1px solid var(--color-light-border);
border-radius: var(--border-radius);
box-shadow: none;
}
overflow: visible;

& markdown-toolbar {
border-radius: var(--border-radius) var(--border-radius) 0 0;
min-height: 38px;
padding: 0 8px 0 0;
gap: 8px;

& .markdown-toolbar-group {
flex: 0 0 auto;
}
& .switch {
border: 0;
background: transparent;
border-radius: 0;
margin: 0 auto -1px 0;
min-height: 38px;
}
/* Forgejo overlaps neighbouring switch items with negative margins and paints the first one. */
& .switch .item {
height: 38px;
min-height: 38px;
margin: 0 !important;
padding: 8px 16px !important;
border: 1px solid transparent;
border-radius: 0;
background: transparent !important;
box-shadow: none;
outline: 0;
color: var(--color-text-light-1);
font-size: 14px;
line-height: 21px;
font-weight: 400;
}
& .switch .item:not(.active):hover {
color: var(--color-text);
}
& .switch .item.active {
border-right-color: var(--color-light-border);
border-left-color: var(--color-light-border);
border-bottom-color: var(--color-body);
background: var(--color-body) !important;
color: var(--color-text);
}
/* The editor's own border already draws the first tab's left edge. */
& .switch .item.active:first-child {
border-left-color: transparent;
border-top-left-radius: var(--border-radius);
}
& .switch .item:focus-visible {
outline: 2px solid var(--github-fgColor-accent);
outline-offset: -2px;
}
& .switch .item.active::before,
& .switch .item.active::after {
display: none;
}
}
& > .ui.tab.markup {
background: var(--color-body);
padding: 16px;
min-height: 136px;
font-size: 14px;
line-height: 21px;
}
& textarea {
margin: 8px;
width: calc(100% - 16px);
height: auto;
min-height: 123px;
max-height: calc(35lh + 18px);
field-sizing: content;
line-height: 21px;
font-family: var(--fonts-proportional);
padding: 8px;
}
}
:is(
.page-content.repository.view.issue.github-conversation .comment.form,
.page-content.repository.new.issue.github-issue-new,
.review-box-panel,
.comment-code-cloud
)
.ui.dropzone {
min-height: 32px;
padding: 0;
border: 0;
background: transparent;
& .dz-message {
margin: 0;
text-align: left;
}
& .dz-button {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 6px 8px;
min-height: 32px;
font-size: 12px;
line-height: 18px;
font-weight: 400;
color: var(--color-text-light-1);
background: transparent;
border: 0;
box-shadow: none;
}
border: 0 !important;
& .dz-button {
color: var(--color-text-light-1) !important;
}
}
147 changes: 0 additions & 147 deletions styles/components/issues/editor.ts

This file was deleted.

2 changes: 0 additions & 2 deletions styles/components/issues/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import { cssCombine } from "@lutinglt/gitea-github-theme/core";
import editor from "./editor";
import issue from "./issue";
import issueComment from "./issue_comment";
import issueConversation from "./issue_conversation";
Expand All @@ -36,7 +35,6 @@ export default cssCombine(
issueList,
issueOverview,
issueConversation,
editor,
issueNew,
pullReview,
pullFilesReview,
Expand Down
1 change: 1 addition & 0 deletions templates/base/component_assets.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/components/common/button/button.css">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/components/common/counter/counter.css">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/components/common/editor/editor.css">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/components/common/empty/empty.css">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/components/common/list-heading/list-heading.css">
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/components/common/menu/menu.css">
Expand Down
Loading