Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to what location generated source maps are pointing in case of composed styles #1653

Merged
merged 1 commit into from
Nov 26, 2019

Conversation

Andarist
Copy link
Member

Currently we get first encountered source maps, but actually more interesting is the last one. Taking first can lead to some unexpected results - like in this example background-color: red styles would point to background-color: green; and it could be even defined in a completely different file.

const StyledText = styled.div`
  @media (min-width: 1040px) {
    ${css`
      background-color: green;
    `}
  }

  background-color: red;
`;

I have no idea right now what kind of a test we should write for this and I'm not sure if it's worth it, so I've skipped it for now.

This actually would also, by accident - sort of, help to workaround the stylis bug: thysultan/stylis#154

@changeset-bot
Copy link

changeset-bot bot commented Nov 25, 2019

🦋 Changeset is good to go

Latest commit: fc2fc74

We got this.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Andarist Andarist requested a review from emmatown November 25, 2019 23:14
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit fc2fc74:

Sandbox Source
Emotion Configuration

@codecov
Copy link

codecov bot commented Nov 25, 2019

Codecov Report

Merging #1653 into next will not change coverage.
The diff coverage is 100%.

Impacted Files Coverage Δ
packages/serialize/src/index.js 100% <100%> (ø) ⬆️

@Andarist Andarist merged commit 5c55fd1 into next Nov 26, 2019
@Andarist Andarist deleted the fix/composed-styles-source-maps branch November 26, 2019 06:31
danielmoore pushed a commit to danielmoore/emotion that referenced this pull request Sep 4, 2020
louisgv pushed a commit to louisgv/emotion that referenced this pull request Sep 6, 2020
@github-actions github-actions bot mentioned this pull request Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants