gajus / gajus/babel-plugin-react-css-modules

SASS @at-root generated class names do not work with plugin

オープン
#81 コメント 8 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
2k
フォーク
159
PR マージ指標
30日以内にマージされた PR はありません

説明

When using SASS `@at-root` directive and referencing the parent class name with `#{&}`, the babel plugin is unable to find a class, but the class exists at runtime. Below is the error I'm getting, here is the basic setup:

```scss
.ResultWrapperHeader {
...
@at-root #{&}__title {
...
}
}
```

Which outputs to:

```css
.ResultWrapperHeader {...}
.ResultWrapperHeader__title {...}
```

The plugin gives me this error message: `Could not resolve the styleName 'ResultWrapperHeader__title'.`

This may just be something that is not supported with the babel plugin version, since the plugin would have to process the sass to css in order to know what the class name is. Is there a way around this issue and still use this nested pattern (other than not using nesting)?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、issue で説明されている Sass スニペットと babel plugin のエラーを再現します。生成された ResultWrapperHeader__title クラスに対する plugin のクラス名解決を追跡します。完了条件は、有効な生成クラスが報告されたエラーなしで解決されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
babel, javascript, react, sass
領域
frontend, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。