Skip to content

Commit

Permalink
feat: vertically aligning text (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
polyrainbow authored Feb 16, 2025
1 parent e36b600 commit c9177b4
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 8 deletions.
4 changes: 4 additions & 0 deletions public/assets/css/app-header.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
background: var(--accent-color-1-light);
border-radius: var(--border-radius);
white-space: nowrap;

span {
text-box: trim-both cap alphabetic;
}

&:hover {
background-color: var(--accent-color-1-intense);
Expand Down
4 changes: 3 additions & 1 deletion public/assets/css/app-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

@media only screen and (max-width: 599px) {
#app-menu-toggle {
display: block;
display: flex;
align-items: center;
justify-content: center;
}
}

Expand Down
19 changes: 17 additions & 2 deletions public/assets/css/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@

h1 {
font-size: var(--h1-font-size);
text-box: trim-both cap alphabetic;
}

input,
Expand Down Expand Up @@ -321,12 +322,17 @@ dialog {
.dialog-text {
margin-top: 0;
font-size: var(--large-font-size);
text-box: trim-both cap alphabetic;
}

.dialog-action-bar {
display: flex;
flex-wrap: wrap;
gap: var(--default-gap);

& > button {
flex-grow: 10;
}
}
}

Expand All @@ -337,6 +343,14 @@ button {
color: var(--font-color);
font-size: var(--default-font-size);

&:not(:has(img)) {
text-box: trim-both cap alphabetic;
}

& > span {
text-box: trim-both cap alphabetic;
}

&[disabled] {
cursor: inherit;
color: var(--alt-content-color);
Expand All @@ -354,7 +368,7 @@ button {
.default-button {
border-radius: var(--border-radius);
font-size: var(--large-font-size);
padding: var(--small-interactive-element-padding) 1.25rem;
padding: 1rem;
user-select: none;

&:disabled {
Expand Down Expand Up @@ -407,7 +421,8 @@ button {
}

.floating-action-button {
display: block;
display: flex;
align-items: center;
position: fixed;
bottom: 1.25rem;
right: 1.25rem;
Expand Down
8 changes: 8 additions & 0 deletions src/components/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useEffect, useRef } from "react";
import Overlay from "./Overlay";

const Dialog = ({
Expand All @@ -9,10 +10,17 @@ const Dialog = ({
onClickOnOverlay: () => void;
className?: string;
}) => {
const ref = useRef<HTMLDialogElement | null>(null);

useEffect(() => {
ref.current?.showModal();
});

return <Overlay
onClick={onClickOnOverlay}
>
<dialog
ref={ref}
className={className ?? ""}
onClick={(e) => e.stopPropagation()}
>
Expand Down
3 changes: 1 addition & 2 deletions src/components/HeaderButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ const HeaderButton = ({
onDragEnd={onDragEnd}
onDragOver={onDragOver}
className={
"header-button "
+ (icon ? "with-icon" : "without-icon")
(icon ? "with-icon" : "without-icon")
+ (className ? (" " + className) : "")
+ (dangerous ? (" dangerous") : "")
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/NoteContentBlockAudio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const NoteContentBlockAudio = ({
file,
notesProvider,
}: NoteContentBlockAudioProps) => {
const [url, setUrl] = useState<string>("");
const [url, setUrl] = useState<string | undefined>(undefined);

useEffect(() => {
getObjectUrlForArbitraryGraphFile(file)
Expand Down
2 changes: 1 addition & 1 deletion src/components/NoteContentBlockVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const NoteContentBlockVideo = ({
file,
notesProvider,
}: NoteContentBlockVideoProps) => {
const [url, setUrl] = useState<string>("");
const [url, setUrl] = useState<string | undefined>(undefined);

useEffect(() => {
getObjectUrlForArbitraryGraphFile(file)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Pagination = ({
}
{...item}
>
{type === "previous" ? "<" : ">"}
{type === "previous" ? "" : ""}
</button>
);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions tests/visual-regression/editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,24 @@ test.describe("Editor", () => {
expect(await page.locator(".note").screenshot())
.toMatchSnapshot("editor-note-stats-with-files-light.png");
});

test("modal - light", async ({ page }) => {
page.emulateMedia({ colorScheme: "light" });

page.keyboard.type(" ");
await page.click("#button_new");

expect(await page.screenshot())
.toMatchSnapshot("editor-modal-light.png");
});

test("modal - dark", async ({ page }) => {
page.emulateMedia({ colorScheme: "dark" });

page.keyboard.type(" ");
await page.click("#button_new");

expect(await page.screenshot())
.toMatchSnapshot("editor-modal-dark.png");
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c9177b4

Please sign in to comment.