[Bug]: Inherited CSS white-space cascades into shadow boundary; :host reset is not reliable
メンテナーはふだん 2 日以内に返信
@radium-v がすでに取り組んでいます。
2026年6月10日 から。
評価
この issue はまだ評価されていません。
説明
Related Issue
Follow-up to #36282 — splitting into focused issues for clearer tracking.
Component
All components with shadow DOM
Package version
3.0.0-rc.15
@microsoft/fast-element version
2.10.4
Environment
System:
OS: macOS 15.7.7
CPU: (8) x64 Apple M2
Memory: 20.61 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Chrome: 149.0.7827.53
Edge: 148.0.3967.96
Safari: 26.0.1
npmPackages:
@fluentui/react-components: 9.73.8 => 9.73.8
@fluentui/web-components: 3.0.0-rc.15 => 3.0.0-rc.15
@microsoft/fast-element: ^2.10.4 => 2.10.4
Current Behavior
CSS properties like white-space inherit through the shadow boundary, affecting internal component rendering. When a parent sets white-space: pre or similar, it cascades into the component and changes layout behavior unexpectedly.
Additionally, using :host { white-space: normal; } as a defensive reset has a weakness — it can be overridden by greedy * selectors in consumer styles.
Current workarounds
- Consumer-side patch: Set
fluent-field { white-space: normal; }in light DOM - Component-side
:hostreset: Setwhite-space: normalon:hostin shadow stylesheet- ⚠️ Can be overridden by consumer
*selectors
- ⚠️ Can be overridden by consumer
Proposed Solutions
- Wrapper root element with
white-spacereset — Wrap template content in an element withwhite-space: normal(more resilient but changes DOM structure). A root element encapsulates more effectively than :host :hostreset forwhite-space— Addwhite-space: normalto:hostin component stylesheets (with caveat that consumer*selectors can override)- Eliminate whitespace from templates — Ship single-line templates in ESM (requires per-template care since some whitespace may be structural)
Expected Behavior
Components should encapsulate their internal styling and not be affected by inherited CSS properties from parent elements.
Reproduction
https://stackblitz.com/edit/vitejs-vite-vcgc2r59?file=src%2Fmain.js
Steps to reproduce
- Open the StackBlitz reproduction
- Observe how inherited
white-spacevalues affect component rendering - Try applying
:host { white-space: normal; }and note it can still be overridden
Are you reporting an Accessibility issue?
None
Suggested severity
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
- Check that there is not already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
- 主要言語
- TypeScript
- スター
- 20.4k
- フォーク
- 3k
- 平均マージ
- 3日 21時間
- マージ済み PR(30日)
- 99
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/fluentui のほかの issue
-
[Bug]: Accordion crashes for scalar `defaultOpenItems={0}` (headless and styled v9)対応中かも @arniebradfo が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
[Bug]: Button shims in react-migration-v8-v9 always render the ms-Button--primary class対応中かも @jakesalvesen が 13 日前に担当しました。 オープンComponent: Button Fluent UI react-components (v9) Type: Bug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
[Bug]: AreaChart renders SVG rect with negative width and height on initial render対応中かも @AtishayMsft が 9 日前に担当しました。 オープンPackage: charting Type: Bug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/fluentui#36976 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
[Bug]: Vertical Slider still logs the deprecated 'slider-vertical' warning in Chromium 132+対応中かも @jakesalvesen が 16 日前に担当しました。 オープンComponent: Slider Fluent UI react-components (v9) Type: Bug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
microsoft/fluentui#36945 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
[Bug]: fluent-checkbox submits "on" when the checked attribute is before value対応中かも @FOWEPJF255 が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
microsoft/fluentui の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信
-
reproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
anomalyco/opencode#62052 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
strapi/design-system#2084 ·
メンテナーはふだん 3 日以内に返信
-
check:passed streams:remove
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
OAuth documentation for GET /api/v2/users/me/ appears inconsistent with required global read scopeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信