Skip to content
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

Improve breakout CSS #85

Closed
Rich-Harris opened this issue Sep 24, 2024 · 3 comments
Closed

Improve breakout CSS #85

Rich-Harris opened this issue Sep 24, 2024 · 3 comments

Comments

@Rich-Harris
Copy link
Member

There's lots of places where our CSS could be given a facelift, but one of the biggest wins is probably to improve the way our breakouts look — I find these a bit too jarring...

image

...and even more so in dark mode:

image

And our new 'legacy mode' details don't mesh with them very well:

image

We also don't have a way to distinguish between different kinds of note. I think it would be nice to have something like this in our system, and I think it would be great if the legacy mode details looked consistent with them (notwithstanding the fact that they're toggleable, unlike other notes).

Speaking of legacy mode details, authoring-wise I think we should replace this...

<details class="legacy">
<summary>Legacy mode</summary>

In Svelte 4, state was implicitly reactive if the variable was declared at the top level

```svelte
<script>
	let count = 0;
</script>

<button on:click={() => count++}>
	clicks: {count}
</button>
```

</details>

...with this:

> [!LEGACY]
> In Svelte 4, state was implicitly reactive if the variable was declared at the top level
>
> ```svelte
> <script>
> 	let count = 0;
> </script>
>
> <button on:click={() => count++}>
> 	clicks: {count}
> </button>
> ```
@dummdidumm
Copy link
Member

dummdidumm commented Sep 25, 2024

Regarding the syntax: I was wondering if it's worth it to investigate switching it around: Instead of using .md files and have chain of custom preprocessors in place, let's use .svelte files with preprocessors. A bit like (or maybe even using) this: https://www.samplekit.dev/

A file would then look a bit like this:

<Heading>Foo bar</Heading>

blabla

<SubHeading>Sub bar</SubHeading>

more stuff

<!-- codeblock
\`\`\`js
...
\`\`\`
--->

<Legacy>
  In Svelte 4 ...
</Legacy>

It would also open up the door for more unique elements, like adding interactive inline elements, playing around with images more, etc.

The one drawback I see is that it's harder to incorporate readmes like the ones from v-p-s, and the hardcore "I only read docs on github" people will have a harder time reading the docs.

@benmccann
Copy link
Member

I think something like > [!LEGACY] would be a nice solution similar to https://github.com/orgs/community/discussions/16925

@Rich-Harris
Copy link
Member Author

closed via #167

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

No branches or pull requests

3 participants