Skip to content

Lazy loaded Linaria components have wrong specificity when decorated with styled() #1415

@jalooc

Description

@jalooc

Environment

  • Linaria version: 6.2.0
  • Linaria React version: 6.2.1
  • Bundler (+ version): Vite @5.2.13
  • Node.js version: v22.2.0
  • OS: MacOS

Description

When decorating Linaria components with styled(), the resulting class has proper specificity achieved by chaining classes: .classBaseComponent.classDecoratingComponent, but that does not work if the base component is lazy-loaded.

image image

Reproducible Demo

https://stackblitz.com/edit/stackblitz-starters-ldrzpa

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug report 🦗Issue is probably a bug, but it needs to be checkedneeds: complete repro 🖥️Issue need to have complete repro provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions