Cannot specify media query in different module - Invalid pseudo or at-rule.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- JavaScript
- スター
- 3.6k
- フォーク
- 208
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react/react-strict-dom のほかの issue
-
Outline styles aren't parsed in React Native対応中かも @hoangvvo が 148 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
react/react-strict-dom#467 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
react/react-strict-dom#465 · コメント 2 件 ·
-
postcss plugin re-transforms every included file on each rebuild under Turbopack (minutes-long HMR in large projects)対応中かも @borisyankov が 17 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
react/react-strict-dom#520 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
react/react-strict-dom#505 · リアクション 2 件 ·
-
Button remains unclickable after disabled state changes対応中かも @MoOx が 131 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
react/react-strict-dom#491 · コメント 4 件 ·
react/react-strict-dom の issue をすべて見る
似ている issue
-
documentation good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug release:v5.56
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Jason-Vaughan/TangleClaw#2270 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
style-dictionary/style-dictionary#1773 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SignalK/signalk-server#3143 ·
メンテナーはふだん 1 日以内に返信