You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Making a column out of a wide text is very common rule.
Is it possible to provide such functionality this at the tutorialkit level? Add a class perhaps?
This should be called TutorialContent that can be overriden with https://tutorialkit.dev/guides/overriding-components/. Then users can create their own TutorialContent with any styling and classnames they need, and define it in configuration as:
Activity
AriPerkkio commentedon Sep 9, 2024
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
theme.cssand define your styles there:iliakan commentedon Sep 9, 2024
Thank you. I see it's easy to do, but this column in this layout encompasses the whole website, which is a bit different thing.
Usually, it's only the text which is columnized, while the header/footer remains wide.
Here's medium.com for example:
AriPerkkio commentedon Sep 9, 2024
How about adding it directly into the
content.mdand not usetheme.cssat all?iliakan commentedon Sep 9, 2024
...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.
Is it possible to provide such functionality this at the tutorialkit level? Add a class perhaps?
AriPerkkio commentedon Sep 9, 2024
I would recommend to create re-usable Astro component and use that in the lessons that are hiding preview and terminal. Something like:
What kind of configurable API should this have on TutorialKit's side?
iliakan commentedon Sep 9, 2024
I would suggest just adding a CSS class to the
divwith the lesson text. Then a simpletheme.csswould allow to configure it.Because content files should be about content as much as possible. It'd be much better to do such a generic thing with CSS.
AriPerkkio commentedon Sep 16, 2024
As solution, let's add support for overriding the elements that render markdown here:
tutorialkit/packages/astro/src/default/components/TutorialContent.astro
Lines 15 to 17 in afbc81f
This should be called
TutorialContentthat can be overriden with https://tutorialkit.dev/guides/overriding-components/. Then users can create their ownTutorialContentwith any styling and classnames they need, and define it in configuration as:[-]No-editor layout column width[/-][+]Override components: TutorialContent[/+]