8000 [DISCUSSION] Dynamic loading style (CSS) and theming support · Issue #340 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content
[DISCUSSION] Dynamic loading style (CSS) and theming support #340
Closed
@fpliger

Description

@fpliger

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. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogissue has been triaged but has not been earmarked for any upcoming releaseideasIdeas worth exploringlang: typescriptRelated to the Typescript languagetag: stylingRelated to the styling of pyscript componentstype: featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0