Skip to content

Commit

Permalink
[WEB-1119] style: editor typography, borders and alignment throughout…
Browse files Browse the repository at this point in the history
… the platform (#4322)

* chore: new font sizes

* chore: update space app editor border

* chore: issue detials page x-padding

* chore: editor width
  • Loading branch information
aaryan610 authored May 1, 2024
1 parent 2e2747c commit ed4a051
Show file tree
Hide file tree
Showing 20 changed files with 115 additions and 379 deletions.
37 changes: 25 additions & 12 deletions packages/editor/core/src/styles/editor.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.ProseMirror {
--font-size-h1: 1.5rem;
--font-size-h2: 1.3125rem;
--font-size-h3: 1.125rem;
--font-size-h4: 0.9375rem;
--font-size-h5: 0.8125rem;
--font-size-h6: 0.75rem;
--font-size-regular: 0.9375rem;
--font-size-list: var(--font-size-regular);
}

.ProseMirror p.is-editor-empty:first-child::before {
content: attr(data-placeholder);
float: left;
Expand Down Expand Up @@ -56,7 +67,7 @@

/* to-do list */
ul[data-type="taskList"] li {
font-size: 1rem;
font-size: var(--font-size-list);
line-height: 1.5;
}

Expand Down Expand Up @@ -162,7 +173,7 @@ ul[data-type="taskList"] li[data-checked="true"] > div > p {
cursor: text;
line-height: 1.2;
font-family: inherit;
font-size: 14px;
font-size: var(--font-size-regular);
color: inherit;
-moz-box-sizing: border-box;
box-sizing: border-box;
Expand Down Expand Up @@ -310,60 +321,62 @@ ul[data-type="taskList"] ul[data-type="taskList"] {
.prose :where(h1):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 2rem;
margin-bottom: 4px;
font-size: 1.875rem;
font-weight: 700;
font-size: var(--font-size-h1);
font-weight: 600;
line-height: 1.3;
}

.prose :where(h2):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1.4rem;
margin-bottom: 1px;
font-size: 1.5rem;
font-size: var(--font-size-h2);
font-weight: 600;
line-height: 1.3;
}

.prose :where(h3):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1rem;
margin-bottom: 1px;
font-size: 1.25rem;
font-size: var(--font-size-h3);
font-weight: 600;
line-height: 1.3;
}

.prose :where(h4):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1rem;
margin-bottom: 1px;
font-size: 1rem;
font-size: var(--font-size-h4);
font-weight: 600;
line-height: 1.5;
}

.prose :where(h5):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1rem;
margin-bottom: 1px;
font-size: 0.9rem;
font-size: var(--font-size-h5);
font-weight: 600;
line-height: 1.5;
}

.prose :where(h6):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 1rem;
margin-bottom: 1px;
font-size: 0.83rem;
font-size: var(--font-size-h6);
font-weight: 600;
line-height: 1.5;
}

.prose :where(p):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
margin-top: 0.25rem;
margin-bottom: 1px;
padding: 3px 2px;
font-size: 1rem;
padding: 3px 0;
font-size: var(--font-size-regular);
line-height: 1.5;
}

.prose :where(ol):not(:where([class~="not-prose"], [class~="not-prose"] *)) li p,
.prose :where(ul):not(:where([class~="not-prose"], [class~="not-prose"] *)) li p {
font-size: 1rem;
font-size: var(--font-size-list);
line-height: 1.5;
}

Expand Down
2 changes: 1 addition & 1 deletion space/components/editor/rich-text-read-only-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const RichTextReadOnlyEditor = React.forwardRef<EditorReadOnlyRefApi, Ric
mentionHandler={{ highlights: mentionHighlights }}
{...props}
// overriding the customClassName to add relative class passed
containerClassName={cn(props.containerClassName, "relative border border-custom-border-200 p-3")}
containerClassName={cn("relative p-0 border-none", props.containerClassName)}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const RichTextEditor = forwardRef<EditorRefApi, RichTextEditorWrapperProp
suggestions: mentionSuggestions,
}}
{...rest}
containerClassName={cn(containerClassName, "relative min-h-[150px] border border-custom-border-200 p-3")}
containerClassName={cn("relative min-h-[150px] pl-3", containerClassName)}
/>
);
});
Expand Down
2 changes: 1 addition & 1 deletion web/components/inbox/content/issue-properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const InboxIssueContentProperties: React.FC<Props> = observer((props) =>
if (!issue || !issue?.id) return <></>;
return (
<div className="flex h-min w-full flex-col divide-y-2 divide-custom-border-200 overflow-hidden">
<div className="h-min w-full overflow-y-auto px-5">
<div className="h-min w-full overflow-y-auto px-3">
<h5 className="text-sm font-medium my-4">Properties</h5>
<div className={`divide-y-2 divide-custom-border-200 ${!isEditable ? "opacity-60" : ""}`}>
<div className="flex flex-col gap-3">
Expand Down
21 changes: 13 additions & 8 deletions web/components/inbox/content/issue-root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const InboxIssueMainContent: React.FC<Props> = observer((props) => {

return (
<>
<div className="rounded-lg space-y-4">
<div className="rounded-lg space-y-4 pl-3">
<IssueTitleInput
workspaceSlug={workspaceSlug}
projectId={issue.project_id}
Expand All @@ -124,6 +124,7 @@ export const InboxIssueMainContent: React.FC<Props> = observer((props) => {
issueOperations={issueOperations}
disabled={!isEditable}
value={issue.name}
containerClassName="-ml-3"
/>

{loader === "issue-loading" ? (
Expand All @@ -140,6 +141,7 @@ export const InboxIssueMainContent: React.FC<Props> = observer((props) => {
disabled={!isEditable}
issueOperations={issueOperations}
setIsSubmitting={(value) => setIsSubmitting(value)}
containerClassName="-ml-3 border-none"
/>
)}

Expand All @@ -152,12 +154,15 @@ export const InboxIssueMainContent: React.FC<Props> = observer((props) => {
/>
)}
</div>
<IssueAttachmentRoot
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issue.id}
disabled={!isEditable}
/>

<div className="pl-3">
<IssueAttachmentRoot
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issue.id}
disabled={!isEditable}
/>
</div>

<InboxIssueContentProperties
workspaceSlug={workspaceSlug}
Expand All @@ -168,7 +173,7 @@ export const InboxIssueMainContent: React.FC<Props> = observer((props) => {
duplicateIssueDetails={inboxIssue?.duplicate_issue_detail}
/>

<div className="pb-12">
<div className="pb-12 pl-3">
<IssueActivity workspaceSlug={workspaceSlug} projectId={projectId} issueId={issue.id} />
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion web/components/inbox/content/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const InboxContentRoot: FC<TInboxContentRoot> = observer((props) => {
isSubmitting={isSubmitting}
/>
</div>
<div className="h-full w-full space-y-5 divide-y-2 divide-custom-border-300 overflow-y-auto p-5 vertical-scrollbar scrollbar-md">
<div className="h-full w-full space-y-5 divide-y-2 divide-custom-border-200 overflow-y-auto px-6 py-5 vertical-scrollbar scrollbar-md">
<InboxIssueMainContent
workspaceSlug={workspaceSlug}
projectId={projectId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const InboxIssueCreateRoot: FC<TInboxIssueCreateRoot> = observer((props)
data={formData}
handleData={handleFormData}
editorRef={descriptionEditorRef}
containerClassName="border-[0.5px] border-custom-border-200 py-3"
/>
<InboxIssueProperties projectId={projectId} data={formData} handleData={handleFormData} />
<div className="relative flex justify-between items-center gap-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export const InboxIssueEditRoot: FC<TInboxIssueEditRoot> = observer((props) => {
data={formData}
handleData={handleFormData}
editorRef={descriptionEditorRef}
containerClassName="border-[0.5px] border-custom-border-200 py-3"
/>
<InboxIssueProperties projectId={projectId} data={formData} handleData={handleFormData} isVisible />
<div className="relative flex justify-end items-center gap-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getDescriptionPlaceholder } from "@/helpers/issue.helper";
import { useProjectInbox } from "@/hooks/store";

type TInboxIssueDescription = {
containerClassName?: string;
workspaceSlug: string;
projectId: string;
workspaceId: string;
Expand All @@ -21,7 +22,7 @@ type TInboxIssueDescription = {

// TODO: have to implement GPT Assistance
export const InboxIssueDescription: FC<TInboxIssueDescription> = observer((props) => {
const { workspaceSlug, projectId, workspaceId, data, handleData, editorRef } = props;
const {containerClassName, workspaceSlug, projectId, workspaceId, data, handleData, editorRef } = props;
// hooks
const { loader } = useProjectInbox();

Expand All @@ -42,6 +43,7 @@ export const InboxIssueDescription: FC<TInboxIssueDescription> = observer((props
dragDropEnabled={false}
onChange={(_description: object, description_html: string) => handleData("description_html", description_html)}
placeholder={getDescriptionPlaceholder}
containerClassName={containerClassName}
/>
</div>
);
Expand Down
Loading

0 comments on commit ed4a051

Please sign in to comment.