-
Notifications
You must be signed in to change notification settings - Fork 48
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
Override components: TutorialContent #319
Comments
Does this layout look correct? https://stackblitz.com/~/edit/vitejs-vite-zhhoys?file=theme.css&file=src/content/tutorial/1-basics/1-introduction/1-welcome/content.md&terminal=dev Add a html {
background-color: var(--tk-background-primary);
}
body {
max-width: 600px;
margin-inline: auto;
} ---
type: lesson
title: Welcome to TutorialKit
editor: false
previews: false
terminal: false
---
# Welcom to TutorialKit
Lorem ipsum... |
...You mean add this to every content.md file? Technically possible, but doesn't look good ;) Making a column out of a wide text is very common rule. |
I would recommend to create re-usable Astro component and use that in the lessons that are hiding preview and terminal. Something like: ---
type: lesson
...
---
import NarrowLayout from '@component/NarrowLayout';
<NarrowLayout>
# Welcom to TutorialKit
Lorem ipsum dolor...
</NarrowLayout> What kind of configurable API should this have on TutorialKit's side? |
I would suggest just adding a CSS class to the Because content files should be about content as much as possible. It'd be much better to do such a generic thing with CSS. |
As solution, let's add support for overriding the elements that render markdown here:
This should be called import tutorialkit from '@tutorialkit/astro';
import { defineConfig } from 'astro/config';
export default defineConfig({
integrations: [
tutorialkit({
components: {
TutorialContent: './src/components/TutorialContent.astro',
},
}),
],
}); |
For information-only lessons without an editor, the text occupies the full width, which is too much.
Content-oriented websites, such as https://medium.com/ and others limit text width, they make it a narrow column with margins.
For example medium.com - it's 680px:
I'd like to do the same.
I can add
width: 680; margin:auto
using dev tools to get it, like this:What is the correct way to do this? Without a need to patch tutorialkit?
I guess, this isn't just about me. Wide texts are usually fit into columns on most sites, hopefully there's a way =).
P.P.S. With an editor, another layout should apply, probably with the editor taking extra right space and no margin. This request is only about the "editor: false" layout.
The text was updated successfully, but these errors were encountered: