fix(docs): improve Stack and Foreach demo contrast

FA
2d ago
+103-7

Summary

  • Pin black text on the four fixed orange/lightblue Stack boxes in docs/styling/layout.md (WEB-013). This is not the component-reference page already fixed by #7676.
  • Darken the red, teal and orange Foreach swatches consistently across list, indexed, dictionary and nested dictionary examples (DOC-F06), preserving the shared white labels. Calculated opaque sRGB contrast is now 5.21:1, 4.56:1 and 4.51:1 respectively.
  • Add regression coverage for all six swatch colors and explicit Stack foregrounds, plus a docs changelog.

Existing fix / overlap checks

Checked current main c2d50fb2cb75c69fd11c82bef7e76efd800db8cf and open PR searches. #7676 fixes separate docs/library/layout/ pages, not this styling guide. #7657 fixes the Foreach todo/grid but not these swatches.
#7872 adds browser assertions for the old swatch hex/RGB values without fixing contrast. Its expectations must be updated to this palette when the branches are integrated (red rgb(206, 44, 49), teal rgb(0, 133, 115), orange rgb(204, 78, 0)). This PR deliberately does not duplicate its browser-test infrastructure.

Validation

  • Regression tests written first: both failed on main, then passed after the changes.
  • 8 focused contrast tests passed (new tests plus existing layout and Cond coverage).
  • Repository-wide ruff check . passed; new test formatting and git diff --check passed.
  • Evaluated executable/demo blocks and rendered all four affected Foreach examples successfully.
  • pyright reflex tests: one error in unchanged tests/units/docgen/test_class_and_component.py:397 (field overload), plus two pre-existing unused-expression warnings.
  • Full docs build and interactive light/dark/browser QA are not yet verified. Local Chromium cannot start: socket() failed: Operation not permitted. A supported local docs preview was also attempted after installing its dependencies, but stops because reflex-enterprise requires login or REFLEX_ACCESS_TOKEN; no preview was launched. No deployed-fix claim.

Before / after screenshots

Pending. Keep this PR draft. Genuine live before captures exist from the bug hunt; after captures require an accessible branch preview. Screenshot attachment/visual verification is an explicit completion requirement, not waived by passing source tests.

Review

Focused source review found no changes to public APIs or demo interactions. Remaining review concern: coordinate the literal color expectations with #7872. Nothing merged or deployed.