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
6 changes: 6 additions & 0 deletions src/build-output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,12 @@ describe("Forgejo 15 native integration", () => {
expect([...order].sort((a, b) => a - b)).toEqual(order);
});

it("joins the file editor's tabs and find button to the editor as GitHub's box header", () => {
const style = fs.readFileSync(path.join(ROOT_DIR, "styles", "components", "repo", "repo_file_view.ts"), "utf-8");
expect(style).toContain("#editor-bar ~ .ui.bottom.tab.segment {");
expect(style).toContain("background: ${themeVars.color.box.header};");
});

it("matches GitHub's repository About, visibility, and code-search details", () => {
const headerStyle = fs.readFileSync(path.join(ROOT_DIR, "styles", "templates", "repo", "header.ts"), "utf-8");
const headerTemplate = fs.readFileSync(path.join(ROOT_DIR, "templates", "repo", "home_header.tmpl"), "utf-8");
Expand Down
25 changes: 24 additions & 1 deletion styles/components/repo/repo_file_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

import { css, cssCombine, themeVars } from "@lutinglt/gitea-github-theme/core";
import { css, cssCombine, otherThemeVars, themeVars } from "@lutinglt/gitea-github-theme/core";

const codeEditor = css`
.codemirror-container {
Expand Down Expand Up @@ -94,6 +94,29 @@ const fileEditor = css`
#editor-bar .switch .item svg {
display: none;
}
/* GitHub's editor box: the Edit/Preview tabs and the find button in a header bar joined to the editor. */
#editor-bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin: 0;
padding: 8px;
border: 1px solid ${themeVars.color.light.border};
border-bottom: 0;
border-radius: ${otherThemeVars.border.radius} ${otherThemeVars.border.radius} 0 0;
background: ${themeVars.color.box.header};
> .button {
height: 32px;
min-height: 32px;
margin: 0;
}
}
#editor-bar ~ .ui.bottom.tab.segment {
margin-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}
`;

Expand Down
Loading