43081j / 43081j/postcss-styled-components

Nested css in template results in skipping template

Open
#7 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
12
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Nesting styled-component `css` inside any styled-component template literal results in the template being skipped.

Example:
```
import styled, { css } from "styled-components"

const Foo = styled.div`
${css`
color: hotpink;
`}
`

```
Output: `[postcss (styled-components)] Skipping template (file: ...) as it included either invalid syntax or complex expressions the plugin could not interpret. Consider using a "// postcss-styled-components-disable-next-line" comment to disable this message`

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue is in the postcss-styled-components syntax parser. Start by examining the parser logic in the source code, likely in a file like 'src/syntax.js' or 'src/parser.js'. Look for the condition that triggers the 'Skipping template' message when nested css is detected. Run the existing tests to see if any cover nested template literals, and add a test case for the provided example to reproduce the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.