-
Notifications
You must be signed in to change notification settings - Fork 12
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
Theming: New Theming Pattern for Easier Customization #187
Comments
This is a list to track the current work on stage 1 Unstable:* ( wait to refactor until later )
Stable: ( can be refactored now )
|
|
This is part of #187, more details can be found there.
@hnb-ku I feel like the I think the I'm totally fine keeping it like that if you think it's a good idea for any reason, I just wanted to double-check. |
Yes, you're right. We'd just have The reason behind this is that Svelete "requires" Creating a separate "Page" component (that we control inside a In other words, a theme can provide its own Additionally, any lingering route logic that needs to happen on the client can be created there. This includes something like client-side transformations (but we still prefer server-side data if possible). I'm definitely open to any option here and one of the biggest goals is not to bog down core development in any shape of form. This is something I kind of forgot to mention. For new paths and routes that we add for new features, we don't need to follow the pattern in this issue. Everything can just stay in the Let me know if this works for you. |
OK, yeah, that all sounds good. 👍 It's super easy to switch back and forth and isn't hard to understand in either case. |
This is part of #187, more details can be found there.
This is part of #187, more details can be found there.
|
|
This is part of #187, more details can be found there.
This issue proposes a new pattern to make theming the application easier and more maintainable.
Core Idea:
The idea is to shift towards a more component-centric architecture, separating data fetching and logic from presentation, and allowing themes to override both CSS and component templates (with guardrails).
Implementation Details:
+page.svelte
files. Keep most non-client-side logic in+page.server.ts
and pass data down to components.components
folder inside each route, containing smaller components focused on presentation.$lib/components
for global reusability.$props
for Props: Use the$props
rune for accessing props in Svelte 5 components.Theming Vision:
theme.css
file.Guardrails for Theming:
This enables:
Theming Hierarchy:
theme.css
for site-wide styling changes.Page.svelte
component for a route.+page.server.ts
files.Implementation Stages:
$lib
folder.The text was updated successfully, but these errors were encountered: