-
Notifications
You must be signed in to change notification settings - Fork 417
Open
Anber/wyw-in-js
#145Labels
bug report 🦗Issue is probably a bug, but it needs to be checkedIssue is probably a bug, but it needs to be checkedbundler: webpack 📦Issue is related to webpack bundlerIssue is related to webpack bundlerneeds: complete repro 🖥️Issue need to have complete repro providedIssue need to have complete repro provided
Description
Environment
- Linaria version:
6.3.0 - Bundler (+ version): RSPack
1.3.15 - Node.js version:
v22.17.0 - OS: MacOS
Description
Using the % directly after an interpolation doesn't seem to get passed to the helper as mentioned in this doc. px doesn't have this issue.
If we encounter a valid unit directly after the interpolation, it'll be passed to the helper so that the correct unit is used when setting the property.
Reproducible Demo
const Title = styled.h1<{ width: number }>`
width: ${(p) => p.width}%;
`;Turns into
--c1y54dea-1: 83.33333333333334;
width: var(--c1y54dea-1)%;which is invalid css. This should turn into
--c1y54dea-1: 83.33333333333334%;
width: var(--c1y54dea-1);Metadata
Metadata
Assignees
Labels
bug report 🦗Issue is probably a bug, but it needs to be checkedIssue is probably a bug, but it needs to be checkedbundler: webpack 📦Issue is related to webpack bundlerIssue is related to webpack bundlerneeds: complete repro 🖥️Issue need to have complete repro providedIssue need to have complete repro provided