Cannot specify media query in different module - Invalid pseudo or at-rule.
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- typescript
- Bereich
- frontend
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- JavaScript
- Sterne
- 3.6k
- Forks
- 206
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus react/react-strict-dom
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
react/react-strict-dom#467 · 1 Kommentar ·
-
Missing disabled propOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
react/react-strict-dom#465 · 2 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
react/react-strict-dom#520 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
react/react-strict-dom#505 · 2 Reaktionen ·
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
react/react-strict-dom#491 · 4 Kommentare ·
Alle Issues in react/react-strict-dom
Ähnliche Issues
-
factory-active factory-automatic harness/codex task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
vercel/ai#21582 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
ux
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
rr-djk/rr-djuikoo.com#53 ·
Maintainer antworten meist innerhalb von 1 Tag
-
new spec review
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
w3c/browser-specs#2666 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
thim81/openapi-format#238 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
decentespresso/dye2#13 ·