-
Notifications
You must be signed in to change notification settings - Fork 122
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
theme config #442
theme config #442
Conversation
I’m not sure how we’d identify (name) the different style bundles for the page-level options… 🤔 Maybe the answer is that we load the themes (if any) and the stylesheet (defaulting to default.css) as separate requests? Need to think more. |
I've tried to address the todo in #443; this looks totally viable. |
path: string, | ||
resolver: ImportResolver | ||
): Promise<Html> { | ||
const stylesheets = new Set<string>(["https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap"]); // prettier-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we generated the style bundle here, we could scan it for external imports and add preloads here to fix #423.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to update the docs!
some docs in #448 |
The path resolution of the style option isn’t quite correct here. For the project-level option, it should either be resolved relative to the config file or the source root; for the page-level option, it should be resolved relative to the page (the Markdown file). The latter is working as intended, but the former is not. |
I think (??) there is still an issue where using
is not loading the same configuration file as even though I'll double-check later. |
You mean |
Yes. I have these 4 variants, that use the default values either implicitly or explicitly, and so I'd expect them to give the same result:
However they don't. Only [a] and [b] use /docs/ and /observablehq.config.ts as expected.
Is this an artifact of how I'm testing? It's not necessarily a blocker in the sense that it's not blocking any way you'd want to do things, but I find this confusing. |
[c] and [d] aren’t equivalent to [a] and [b], aside from the splice error (which I fixed). The source root is specified by the config file, not the |
Implements the project-level theme option as a shorthand alternative for the style option.
TODO implement the equivalent page-level options, allowing multiple style bundles for the project.Done.Ref. #440 (comment)