Cannot specify media query in different module - Invalid pseudo or at-rule.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by reproducing the issue with media.stylex.ts or media.ts exporting MEDIA and Comp.tsx importing it, using strict-dom 0.0.27. Trace how the imported media key is handled and compare it with an equivalent constant declared in the component module. Done means the cross-module helper works without the “Invalid pseudo or at-rule” error, with regression coverage for the reported example.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the issue
Im getting an error when I try to specify a helper for media queries to not have to write the string in every condition (or a const in every module I want to use it)
Invalid pseudo or at-rule.
If I specify the const in the same module, it works.
It doesn't matter if it is in a .stylex.ts file or .ts only.
// media.stylex.ts or media.ts
export const MEDIA = {
md: "@media (min-width: 1024px)",
lg: "@media (min-width: 1920px)",
};
//Component.tsx
const styles = css.create({
comp: {
width: {
default: 100,
[MEDIA.md]: 200
}
}
})
export const Comp = () => {
return <html.div style={styles.comp} />
}
Expected behavior
Expect to be able to import media query helper from a different module.
Steps to reproduce
Basic setup.
- Create a basic RSD install
- Create a media.stylex.ts file
- Add this block to it
export const MEDIA = {
md: "@media (min-width: 1024px)",
lg: "@media (min-width: 1920px)",
};
- Create a Comp.tsx file
- Add a component using this media query and import the MEDIA const from the other module
const styles = css.create({
comp: {
width: {
default: 100,
[MEDIA.md]: 200
}
}
})
export const Comp = () => {
return <html.div style={styles.comp}>Hello</html.div>
}
Test case
No response
Additional comments
strict-dom version 0.0.27
- Ngôn ngữ chính
- JavaScript
- Star
- 3.6k
- Fork
- 206
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
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 react/react-strict-dom
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
react/react-strict-dom#467 · 1 bình luận ·
-
Missing disabled propĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
react/react-strict-dom#465 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
react/react-strict-dom#520 ·
-
css.defineVars() with kebab-case keys warns unrecognized custom property and fails to resolveĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
react/react-strict-dom#505 · 2 reaction ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
react/react-strict-dom#491 · 4 bình luận ·
Tất cả issue của react/react-strict-dom
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openlibhums/janeway#5604 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Generic OSC does not initialize OSC client on startup when "Listen for Feedback" is disabledĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
area/statement-execution TS conversion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
scylladb/nodejs-rs-driver#584 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
新讀者走讀回報,照著一篇文章實際操作Đang mởdocumentation good first issue help wanted
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Maintainer thường phản hồi trong vòng 3 ngày