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
Hugo and many other static site generators provide multiple pre-built themes, like https://themes.gohugo.io/ that provides nearly 200 themes. This is really handy to quickly explore different styles and get started. I would be great to provide a plugin-like infrastructure that allows users to create a unified theme, so that people can start to write new themes. Once this is done, one can start to think about creating more themes and publishing them on some web pages.
I'm not sure what would be the best technical way to do this, but we can maybe let the user define an alias called mainTheme to some module (say myGreatTheme, that might either be installed via npm, or that is cloned from some repository, allowing the user to easily tweak minor theme options), maybe via https://www.npmjs.com/package/module-alias or maybe some sveltekit alias like https://medium.com/@rizqyhi/adding-new-path-alias-in-sveltekit-1127a1138e7 (to be honest I know very little about how modules work in js), so that later this library could run:
<script>
import {Header} from 'mainTheme'; // See that we use `mainTheme` here instead of `$lib/component`
// …
</script>…<HeadersomeOptionalProps="foo">…</Header>
Ideally, you would also:
document a number of components that are typically needed to be present (possibly refactoring the components provided by this lib to allow greater configurability)
provide a fallback mechanism, so that if myGreatTheme does not provide, say, Header, then we use some default components for greater backward compatibility
provide a way to send to the theme with some options, like maybe mainTheme comes in a dark and light style.
allow the user to easily change a nested component, like maybe a given theme uses some buttons, then the theme might want to be able to allow the user to overwrite the theme of all buttons at once.
I guess that one can get inspired by how flowbite or skeleton work to provide customizable components.
The text was updated successfully, but these errors were encountered:
Hugo and many other static site generators provide multiple pre-built themes, like https://themes.gohugo.io/ that provides nearly 200 themes. This is really handy to quickly explore different styles and get started. I would be great to provide a plugin-like infrastructure that allows users to create a unified theme, so that people can start to write new themes. Once this is done, one can start to think about creating more themes and publishing them on some web pages.
I'm not sure what would be the best technical way to do this, but we can maybe let the user define an alias called
mainTheme
to some module (saymyGreatTheme
, that might either be installed via npm, or that is cloned from some repository, allowing the user to easily tweak minor theme options), maybe via https://www.npmjs.com/package/module-alias or maybe some sveltekit alias like https://medium.com/@rizqyhi/adding-new-path-alias-in-sveltekit-1127a1138e7 (to be honest I know very little about how modules work in js), so that later this library could run:Ideally, you would also:
myGreatTheme
does not provide, say,Header
, then we use some default components for greater backward compatibilitymainTheme
comes in a dark and light style.I guess that one can get inspired by how flowbite or skeleton work to provide customizable components.
The text was updated successfully, but these errors were encountered: