-
Notifications
You must be signed in to change notification settings - Fork 7
Self-hosted: Journal, the first layout-level theme #1446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,4 @@ | |
| @import "./magazine.css"; | ||
| @import "./developer.css"; | ||
| @import "./modern-gradient.css"; | ||
| @import "./journal.css"; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| /* Journal Theme - Ink on paper | ||
| * | ||
| * The first layout-level design: a single centered column, no cards, no | ||
| * sidebar, an author block up top. Serif throughout at a larger scale with | ||
| * generous leading; entries are date, title and excerpt separated by hairline | ||
| * rules. The structural half lives in src/themes/journal/ (Shell and PostCard | ||
| * manifest overrides); these tokens carry the full --theme-* contract so the | ||
| * accent correction sweep and every token utility keep working. | ||
| */ | ||
|
|
||
| [data-style-template="journal"] { | ||
| /* Typography */ | ||
| --theme-font-body: "Source Serif 4", "Georgia", "Times New Roman", serif; | ||
| --theme-font-heading: "Source Serif 4", "Georgia", "Times New Roman", serif; | ||
| --theme-font-ui: | ||
| -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, | ||
| sans-serif; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| /* Typography Sizes */ | ||
| --theme-text-base: 19px; | ||
| --theme-leading-normal: 1.65; | ||
| --theme-tracking-normal: 0; | ||
| --theme-tracking-tight: -0.01em; | ||
|
|
||
| /* Colors - Light: warm paper, near-black ink, burnt sienna accent */ | ||
| --theme-bg-primary: #faf8f4; | ||
| --theme-bg-secondary: #f2efe8; | ||
| --theme-bg-tertiary: rgba(34, 29, 23, 0.05); | ||
| --theme-bg-card: #faf8f4; | ||
|
|
||
| --theme-text-primary: #221d17; | ||
| --theme-text-secondary: rgba(34, 29, 23, 0.75); | ||
| --theme-text-muted: rgba(34, 29, 23, 0.55); | ||
|
qodo-code-review[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| --theme-accent: #9c4a1e; | ||
| --theme-accent-hover: #7f3a15; | ||
| /* Ink on the accent fill: white on #9c4a1e is 5.4:1. */ | ||
| --theme-accent-contrast: #ffffff; | ||
|
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
|
||
|
|
||
| --theme-border: rgba(34, 29, 23, 0.12); | ||
| --theme-border-strong: rgba(34, 29, 23, 0.2); | ||
|
|
||
| /* Effects: paper has no elevation */ | ||
| --theme-radius-sm: 2px; | ||
| --theme-radius: 2px; | ||
| --theme-radius-lg: 4px; | ||
| --theme-radius-full: 9999px; | ||
|
|
||
| --theme-shadow-sm: none; | ||
| --theme-shadow: none; | ||
| --theme-shadow-lg: none; | ||
|
|
||
| /* Link underline style, derived from the accent; see variables.css */ | ||
| --theme-link-decoration: underline; | ||
| --theme-link-decoration-color: color-mix( | ||
| in srgb, | ||
| var(--theme-accent-text, var(--theme-accent)) 40%, | ||
| transparent | ||
| ); | ||
| --theme-link-decoration-hover: var(--theme-accent-text, var(--theme-accent)); | ||
|
|
||
| /* Tag style: quiet, set in the UI face like marginalia */ | ||
| --theme-tag-text: var(--theme-accent-text-light, rgba(34, 29, 23, 0.65)); | ||
| --theme-tag-radius: 2px; | ||
|
|
||
| /* Card treatment: none. An entry is the page surface with a hairline rule. */ | ||
| --theme-card-bg: var(--theme-bg-card); | ||
| --theme-card-border: 1px solid var(--theme-border); | ||
| --theme-card-backdrop: none; | ||
|
|
||
| /* Layout: one measure-width column; the sidebar tokens keep the contract | ||
| * satisfied but the Journal shell renders no sidebar at all. */ | ||
| --theme-content-width: 680px; | ||
| --theme-sidebar-width: 280px; | ||
| --theme-layout-gap: 2.5rem; | ||
| --theme-layout-container-padding: 1.25rem; | ||
| --theme-layout-section-gap: 2.5rem; | ||
| --theme-card-padding: 0px; | ||
| --theme-grid-gap: 2.5rem; | ||
| --theme-grid-columns-tablet: 1; | ||
| --theme-grid-columns-desktop: 1; | ||
| --theme-post-card-image-height: 200px; | ||
| --theme-post-card-image-radius: 2px; | ||
|
qodo-code-review[bot] marked this conversation as resolved.
|
||
| } | ||
|
|
||
| /* Journal Dark Mode: warm charcoal, never blue-black */ | ||
| [data-style-template="journal"][data-theme="dark"] { | ||
| --theme-bg-primary: #17140f; | ||
| --theme-bg-secondary: #1f1b15; | ||
| --theme-bg-tertiary: rgba(247, 242, 234, 0.07); | ||
| --theme-bg-card: #17140f; | ||
|
|
||
| --theme-text-primary: rgba(247, 242, 234, 0.92); | ||
| --theme-text-secondary: rgba(247, 242, 234, 0.75); | ||
| --theme-text-muted: rgba(247, 242, 234, 0.58); | ||
|
|
||
| --theme-accent: #d78d5c; | ||
| --theme-accent-hover: #e5a377; | ||
| /* Ink on the accent fill: the same choice the correction module makes for | ||
| * this fill, so static CSS and runtime preview agree. 7.2:1. */ | ||
| --theme-accent-contrast: #111827; | ||
|
|
||
| --theme-border: rgba(247, 242, 234, 0.12); | ||
| --theme-border-strong: rgba(247, 242, 234, 0.2); | ||
|
|
||
| --theme-link-decoration-color: color-mix( | ||
| in srgb, | ||
| var(--theme-accent-text, var(--theme-accent)) 40%, | ||
| transparent | ||
| ); | ||
| --theme-link-decoration-hover: var(--theme-accent-text, var(--theme-accent)); | ||
|
|
||
| --theme-tag-text: var(--theme-accent-text-dark, rgba(247, 242, 234, 0.65)); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { Link } from '@tanstack/react-router'; | ||
| import type { Entry } from '@ecency/sdk'; | ||
| import { postBodySummary } from '@ecency/render-helper'; | ||
| import { useMemo } from 'react'; | ||
| import { formatDate } from '@/core'; | ||
|
|
||
| interface Props { | ||
| entry: Entry; | ||
| index?: number; | ||
| } | ||
|
|
||
| /** | ||
| * A Journal entry: date, large serif title, excerpt, hairline rule. No card | ||
| * chrome, no image, no counters; the entry is the page surface, the way a | ||
| * personal publication reads. Stats and actions live on the post page. | ||
| */ | ||
| export function JournalPostCard({ entry }: Props) { | ||
| const entryData = entry.original_entry || entry; | ||
|
|
||
| const summary = useMemo( | ||
| () => | ||
| entryData.json_metadata?.description || | ||
| postBodySummary(entryData.body, 220), | ||
| [entryData], | ||
| ); | ||
|
|
||
| // Same canonical link shape the default card uses: the '@' is part of the | ||
| // post URL and the router leaves it unencoded. | ||
| const postParams = useMemo( | ||
| () => ({ author: `@${entryData.author}`, permlink: entryData.permlink }), | ||
| [entryData.author, entryData.permlink], | ||
| ); | ||
| const postSearch = { raw: undefined }; | ||
|
|
||
| return ( | ||
| <article className="py-8 border-b border-theme last:border-b-0"> | ||
| <p className="text-sm text-theme-muted font-theme-ui mb-2"> | ||
| <time dateTime={entryData.created}>{formatDate(entryData.created)}</time> | ||
| {entryData.community && entryData.community_title && ( | ||
| <span> · {entryData.community_title}</span> | ||
| )} | ||
| </p> | ||
| <h2 className="heading-theme text-2xl sm:text-3xl leading-[1.2] mb-3"> | ||
| <Link | ||
| to="/$author/$permlink" | ||
| params={postParams} | ||
| search={postSearch} | ||
| className="no-underline text-theme-primary hover:opacity-80 transition-theme" | ||
| > | ||
| {entryData.title} | ||
| </Link> | ||
| </h2> | ||
| {summary && ( | ||
| <p className="text-theme-secondary leading-relaxed">{summary}</p> | ||
| )} | ||
| </article> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.