CSS Modules
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
No files, tests, or entry points are named. Start by reviewing the proposed cssselect, VDOM selector-engine, and JavaScript approaches, along with the related issue #194. The issue needs a chosen design and acceptance criteria before “done” can be evaluated.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Current Situation
There is built-in method of directly tying a CSS file to a component
Proposed Actions
Design Idea: Apply in-line styles via Python cssselect
We could parse the CSS document using lxml.cssselect and potentially add the styles in-line. This might need us to generate some sort of VDOM-LXML compatibility layer though. Might be difficult to do this in a performant manner, but it would be the easiest way for us to not ever "fall out of date" with new CSS selectors.
Design Idea: Apply in-line styles via Python homebrewed VDOM selector engine
It might be make sense (from a performance standpoint) to homebrew a VDOM-compatible CSS selection engine... There are a couple we can take inspiration from: vtree-select, cssauron. This would be a pretty large undertaking, and gets really tricky with all of the CSS level 3 selectors.
Design Idea: Leverage django_css
django_cssAdd a css_module decorator that loads a stylesheet using django_css(..., only_once=True) (see here: #194).
By default, it will attempt to load the Django static file named <REACTPY_STYLESHEET_SUBDIR>/<COMPONENT_DOTTED_PATH>.css. But the user will be able to override the path using positional args.
Will need a settings.py configuration setting called REACTPY_STYLESHEET_SUBDIR. Additionally, it makes sense for a manual override to exist within the decorator css_module(subdir="...") for library maintainers to use.
This doesn't really "tie" a piece of CSS to a component. It only ties the load time together.
Design Idea: Apply in-line styles via JavaScript (client sided)
It's also possible for us to instead apply the inline styles client-sided, via some kind of JavaScript. There appears to be a package that does this.
This would be pretty janky in terms of loading behavior.
- Ngôn ngữ chính
- Python
- Star
- 357
- Fork
- 22
- Merge trung bình
- 10 giờ 31 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của reactive-python/reactpy-django
-
Add coverage tests Đang mởcomplexity: 3 (low) priority: 3 (low) type: ci
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
complexity: 1 (high) priority: 1 (high)
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
complexity: 2 (medium) priority: 3 (low)
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
complexity: 2 (medium) priority: 3 (low)
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
`pyscript_router` component Đang mởcomplexity: 1 (high) priority: 2 (moderate)
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của reactive-python/reactpy-django
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100