Skip to content

docs(theming): add theming reference to tutorialkit.dev #97

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 26 commits into from
Jun 27, 2024
Merged

Conversation

SamVerschueren
Copy link
Contributor

@SamVerschueren SamVerschueren commented Jun 25, 2024

This PR adds a new theming section to https://tutorialkit.dev.

It probably needs some extra eyes to go through the document and tweak where needed.

While documenting, I also created additional PRs to tweak and improve the theming.

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Jun 25, 2024

⚠️ No Changeset found

Latest commit: 8e75d54

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

cloudflare-workers-and-pages bot commented Jun 25, 2024

Deploying tutorialkit-docs-page with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8e75d54
Status: ✅  Deploy successful!
Preview URL: https://da5700ec.tutorialkit-docs-page.pages.dev
Branch Preview URL: https://docs-theming.tutorialkit-docs-page.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented Jun 25, 2024

Deploying tutorialkit-demo-page with  Cloudflare Pages  Cloudflare Pages

Latest commit: eb24b17
Status: ✅  Deploy successful!
Preview URL: https://1506ecdc.tutorialkit-demo-page.pages.dev
Branch Preview URL: https://docs-theming.tutorialkit-demo-page.pages.dev

View logs

plugins: [starlightLinksValidator()],
plugins: [
starlightLinksValidator({
exclude: ['../guides/**/*'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is related to HiDeoo/starlight-links-validator#39.

@SamVerschueren SamVerschueren changed the title docs(theming): add page to describe how to customize tutorialkit docs(theming): add theming reference to tutorialkit.dev Jun 25, 2024
@sulco
Copy link
Member

sulco commented Jun 25, 2024

This looks great! One thing that I think is still worth improving are the screenshots: looks like they are low resolution so when watching on a higher res screen, they looks blurred + the webp conversion creates some additional artifacts (see the screenshot).

If you don't have access to higher density screen, zooming in the page 200% should do the trick.

Probably not a blocker though;) so though having them nice and sharp would be good, we can fix it later, too
Screenshot 2024-06-25 at 11 51 28@2x

Copy link
Contributor

@d3lm d3lm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work Sam! This looks great.

Here are some other thoughts I had while reviewing:

  • The screenshots seem to be blurry / low res on my end and we ought to fix those

  • Potentially we could re-organize some of the sections to improve the structure a bit but we can always do that later. Like I said, this is great and this is just a thought I had. For instance, we could group related elements together. We could have main sections like "Basic Customization" (Logo, Styling), "UI Elements" (Content, Callouts, Statuses, etc.), and "Interactive Components" (File Tree, Terminal, etc.).

  • We may wanna ensure all sections follow the same pattern of presentation. For example, not all sections have a brief description (I think I commented on the one where it was missing), an image (if applicable), and then the list of customizable tokens. Most section follow this pattern but not all. Also the style of the description of each varies.

  • Later down the road it may be helpful if we provide a bit more context on how these elements are used in the interface.

All of the above is not something we have to fix in this PR or fix at all. Just a couple of thoughts, and the docs and everything is something we have to work on iteratively anyways.

Again, overall this is amazing! Thanks for writing this page Sam!

@SamVerschueren
Copy link
Contributor Author

I'll try to improve some of the points you mentioned @d3lm. I think the screenshots being blury might have something to do with the fact I created them on my external screen. I think I need to create them on my laptop screen. It's annoying that the end result is different.

Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First thing that comes to mind when I started theming: It would be nice to have default theme.css file generated or available elsewhere so that I could directly change the variables there. Copy-pasting variable names from docs works but is a bit slow.

@Nemikolh
Copy link
Member

@AriPerkkio do you think if we had a CLI command that generated a theme.css with all the variables and their current values that would be good enough?

Copy link
Member

@Nemikolh Nemikolh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good!! Good work on this! 🎉

@AriPerkkio
Copy link
Member

@AriPerkkio do you think if we had a CLI command that generated a theme.css with all the variables and their current values that would be good enough?

Yes, something like this would work. Ideally the build process would output separate dist/theme.css that the actual production build uses. This CLI command could then simply either copy the file from dist or use Vite/Astro to emit the file in the root of the project. In this case there would be no need to maintain separate theme.css just for the CLI - it would be 100% the same file that production build uses.

Copy link
Contributor

@d3lm d3lm Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Updated these cause I missed them in the eslint PR.

Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added theming to tutorial-vite-plugin.pages.dev/ using this guide. The final theme.css is here: https://github.com/AriPerkkio/tutorial-vite-plugin/blob/main/theme.css

  • Overall the CSS variables work nicely. It felt like I could style most of the stuff I wanted.
  • Content like <code> and <pre> rendered from markdown were not customizable so I ended up overwriting private APIs:
:root {
  a {
    --link-color: var(--my-color-1);
  }

  pre,
  code {
    --code-background: var(--my-color-2);
    --code-background-color: var(--my-color-3);
    --code-color: var(--my-color-4);
  }
}
  • Theming editor is not documented here - should it be? I ended up styling it anyway using following vars:

    • --tk-elements-editor-backgroundColor
    • --tk-elements-editor-gutter-textColor
    • --tk-elements-editor-gutter-backgroundColor
  • HMR works nicely but having Webcontainers restart on every save is a lot. My browser felt really slow at some points.

  • For some reason --tk-elements-fileTree-file-textColorSelected doesn't work in 0.0.1-alpha.23. It works in TutorialKit's template in main though.

@SamVerschueren
Copy link
Contributor Author

Theming editor is not documented here - should it be?

It should, but I think we need to improve on the editor in general. I would postpone this to a follow-up PR.

For some reason --tk-elements-fileTree-file-textColorSelected doesn't work in 0.0.1-alpha.23. It works in TutorialKit's template in main though.

It could be that I fixed/added this one (can't really remember). If it works on main, I probably did. I found a couple of issues while I was documenting this.

@Nemikolh Nemikolh requested a review from d3lm June 27, 2024 10:25
Copy link
Contributor

@d3lm d3lm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment but LGTM 👍

@Nemikolh Nemikolh merged commit 0644706 into main Jun 27, 2024
8 checks passed
@Nemikolh Nemikolh deleted the docs/theming branch June 27, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants