Skip to content

GlobalStyles using an attribute selector are loaded after regular styles #2993

@joshuajaco

Description

@joshuajaco

Environment

System:

  • OS: macOS 10.15.2
  • CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  • Memory: 1.12 GB / 16.00 GB
  • Shell: 5.7.1 - /bin/zsh

Binaries:

  • Node: 13.7.0 - ~/.asdf/installs/nodejs/13.7.0/bin/node
  • Yarn: 1.21.1 - ~/.asdf/installs/nodejs/13.7.0/.npm/bin/yarn
  • npm: 6.13.6 - ~/.asdf/installs/nodejs/13.7.0/bin/npm

npmPackages:

  • babel-plugin-styled-components: ^1.10.7 => 1.10.7
  • styled-components: ^5.0.0 => 5.0.0

Reproduction

v5.0.0: https://codesandbox.io/s/thirsty-kalam-hi5s8
v4.4.1: https://codesandbox.io/s/strange-mendeleev-pindz

Steps to reproduce

  1. Create a global stylesheet using an attribute selector to set some styles.
  2. Try to overwrite those styles on a component

Expected Behavior

The global styles are overwritten by the component styles, as in v4.4.1

Actual Behavior

The component styles are overwritten

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions