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

Link Django CSS to components (CSS Modules) #227

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Archmonger
Copy link
Contributor

@Archmonger Archmonger commented Feb 10, 2024

Description

Currently, styles can only loosely be tied to components via CSS. This PR allows ReactPy to parse a CSS file and apply the CSS rules as in-line styles.

These styles are applied server-side, so certain limitations are unavoidable. For example, there's no way for media queries to function under this architecture, since the server currently has no way to query client-side DOM properties.

It's going to be an uphill battle to develop support for all CSS psuedo-selectors (ex. :first-child).

Some event based psuedo-selectors are going to be challenging as well (such as :hover). For example, event-based pseudo-selectors (such as :hover) may need to be handled via automatically generated html.script. Would be some ugly stuff though.

This PR may end up pivoting to a different design, or perhaps allow configurability between different client/server side methods of applying CSS.

fix #211

Checklist

Please update this checklist as you complete each item:

  • Tests have been developed for bug fixes or new functionality.
  • The changelog has been updated, if necessary.
  • Documentation has been updated, if necessary.
  • GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

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

Successfully merging this pull request may close these issues.

CSS Modules inspired by ReactJS
1 participant