-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
backlogissue has been triaged but has not been earmarked for any upcoming releaseissue has been triaged but has not been earmarked for any upcoming releaseideasIdeas worth exploringIdeas worth exploringlang: typescriptRelated to the Typescript languageRelated to the Typescript languagetag: stylingRelated to the styling of pyscript componentsRelated to the styling of pyscript componentstype: featureNew feature or requestNew feature or request
Description
PyScript currently "requires" users to load the CSS explicitly and separately from the JS. This has a few limitations:
- locks the flexibility of customizing style
- forces to load all the styles before the JS logic itself (adding up to the loading time, even if just a little)
- not friendly to support theming
- users have to specify 2 cmds to load PyScript on their pages (link to CSS and script to js)
If we switch to lading CSS dynamically within the scope of pyscript.js we can:
- have a default global style that loads if not stylesheet or theme has been specified
- allow users to create stylesheets/themes on their own that can be used instead of the default one
- have more control over what's being loaded into the page and when
- reduce the amounts of steps needed for a user to start using PyScript
In terms of implementation, we could allow users to specify a theme for the app in the AppConfig yaml that can be loaded in runtime.
Would love to hear opinions about the good and bad of the different approaches and possible alternative solutions. :)
pnhearer and sugatoraysugatoray and pnhearersugatoray
Metadata
Metadata
Assignees
Labels
backlogissue has been triaged but has not been earmarked for any upcoming releaseissue has been triaged but has not been earmarked for any upcoming releaseideasIdeas worth exploringIdeas worth exploringlang: typescriptRelated to the Typescript languageRelated to the Typescript languagetag: stylingRelated to the styling of pyscript componentsRelated to the styling of pyscript componentstype: featureNew feature or requestNew feature or request