DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

Tailwind Utilities Losing to globals.css? Check Cascade Layers First

An unlayered global rule can defeat a Tailwind utility before specificity is compared. Learn how layer order, broad selectors, and !important affect the fix.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a Tailwind utility appears to have no effect, the cause may be cascade-layer precedence—not a selector that needs more specificity. For normal author declarations, unlayered CSS outranks CSS inside a cascade layer, and the browser resolves layer precedence before specificity. That means even a global * rule can beat a utility class.

Why can globals.css override a Tailwind utility?

CSS resolves competing declarations through the cascade. When declarations come from the same origin and have the same importance, layer precedence is considered before selector specificity. Among normal author declarations, a declaration in a later layer outranks one in an earlier layer, while an unlayered declaration outranks declarations in any layer.

As an Amazon Associate I earn from qualifying purchases.

Tailwind v4 generates utility CSS within cascade layers. If a handwritten global stylesheet contains a normal declaration outside any layer, that declaration can therefore win before the browser compares selectors. A utility class may look more specific, but specificity does not rescue it from an earlier cascade decision.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is the reported explanation for a case in Daniel Pertu’s October 1, 2026 account of a Tailwind v4 application called CogniPrep. Pertu described a 719-line app/globals.css with 17 !important declarations. Those are figures from the author’s account of one application, not general Tailwind statistics; the application’s code was not independently verified.

#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

How did one global border rule defeat so many utilities?

Pertu identified this unlayered rule as the clearest example:

* {
  border-color: var(--border);
}

The selector’s specificity is zero, but its normal declaration is unlayered. According to Pertu, it consequently overrode Tailwind’s layered border-color utilities in the application. A code comment recorded 514 affected utilities at the time; a later repository grep reportedly found about 800. Both counts are application-specific figures reported by the author, not independently checked totals or a measure of how often this happens in Tailwind projects.

One visible symptom was a CSS triangle rendered as a solid rectangle. The triangle relied on transparent left and right borders and a colored top border. The global border-color rule reportedly colored the side borders, removing the transparency that made the triangle shape work.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When is moving a default into a layer the right fix?

If a global declaration is meant to provide a default that utilities can override, place it in an appropriate lower-priority layer and make sure the project’s effective layer order puts utilities later. Pertu reported changing the rule to:

Rank #3
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
@layer base {
  * {
    border-color: var(--border);
  }
}

This works only when the relevant utility layer comes later than base. Check the actual layer order in the compiled stylesheet rather than assuming the layer name alone guarantees the result.

Approach Normal-declaration effect When it fits What to verify
Leave the global rule unlayered It outranks declarations inside cascade layers, regardless of their selector specificity. Only when the rule is intentionally meant to take precedence over layered rules. Whether the rule is unexpectedly matching utility-related elements or defeating utilities that should win.
Put the default in a named layer Its precedence depends on that layer’s position relative to other layers. When the declaration is a baseline that later-layer utilities should override. The effective layer order, the rule’s selector breadth, and whether any competing declaration is important.

What other global-selector failures did the author report?

The same account describes several other conflicts. They illustrate why a utility can fail because of global CSS outside the component where the symptom appears. These are the author’s reported incidents, not independently reproduced cases.

A layout rule overrode a full-screen shell

An unlayered main rule set min-height: calc(100dvh - 3.5rem) and contain: layout style paint. Pertu said it overrode min-h-0 flex-1 in full-screen shells, letting content exceed the viewport and pushing a primary button below the visible screen.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A substring selector matched utility-class names

A broad selector involving [class*='bg-card'] was narrowed after it affected card border utilities, including opacity variants whose class names contained the matching substring. Substring selectors can silently catch existing or future utility classes beyond the elements their author intended to target.

A border utility override removed a one-pixel line

Pertu also reported a .border-t override that removed top borders from a component using a one-pixel rule. The reported workaround was border-t-[1.5px] border-current, chosen to avoid that exact selector. Treat this as a case-specific workaround, not a general replacement for finding and correcting an unintended global rule.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How should you trace a utility that is not taking effect?

  1. Inspect the computed property. In browser developer tools, select the affected element and find the property that is wrong, such as border-color or min-height. Identify the winning declaration, its selector, and whether it belongs to a cascade layer.
  2. Check the compiled CSS. Find both the global declaration and the generated utility rule. Confirm their layer membership and the effective order of the layers; source-file order alone may not explain the winner.
  3. Choose the intended precedence. If the global declaration is a default, put it in an appropriate lower-priority layer so the utility layer can override it. If it is intended to win, keep that behavior deliberate rather than relying on an accidental unlayered rule.
  4. Narrow the selector. Replace broad selectors that match many elements or inspect class-name substrings with selectors that express the actual scope. This reduces unintended matches, including matches against utility variants added later.
  5. Recalculate the cascade for important declarations. Do not apply the normal-declaration layer rule unchanged: layer order is reversed for !important declarations. Check importance and layer precedence separately before changing specificity.

Why does adding specificity often fail?

Specificity matters only after the cascade has compared higher-priority factors such as origin, importance, and layer. If a normal unlayered global rule beats a normal layered utility at the layer stage, making the utility selector more specific does not change that result. First establish which declaration wins and why; then decide whether the repair belongs in layer placement, selector scope, or importance.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.