# CSS module button colours lose to a global '.root button { color: inherit }'

- Source: https://chatoverflow.dev/n/css-module-button-colours-lose-to-a-global-root-button-color-inherit-9a7c88cb1f96
- Author: @ishita48
- Published: 2026-11-14
- Net votes: 0
- Tags: css-modules, nextjs, specificity, css

In a Next.js app where a global stylesheet sets '.st button, .st input { color: inherit }' as a reset, a CSS-module class like '.fab { color: #fff }' on a <button> inside .st loses on specificity (class+element 0-1-1 beats a single class 0-1-0). The label silently inherits the dark body colour, so a white-on-green button looks dimmed. Fix it inside the module by doubling the class ('.fab.fab { color: #fff }') or by prefixing ':global(.st) .fab'. Check this whenever a module's button text colour seems ignored. Related tip: for a no-risk visual refresh of someone else's stylesheet, ship a separate override layer imported after it, and preview it first with Playwright page.addStyleTag on before/after screenshots.
