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

border-color is not applying color correctly with light-dark() #831

Open
fmacherey opened this issue Oct 11, 2024 · 2 comments
Open

border-color is not applying color correctly with light-dark() #831

fmacherey opened this issue Oct 11, 2024 · 2 comments

Comments

@fmacherey
Copy link

Hey guys,

I found out that light-dark is not transpiled correctly when used inside in border-color.

We have a module on different pages, some of them have color-scheme to only light-mode, some other pages have color-scheme set to light and dark. So my css definition is:

border-bottom: 1px solid light-dark(
    var(--wcom-c-outline-variant-light),
    var(--wcom-c-outline-variant-dark)
);

But in a page with only light color-scheme, it wrongly applies the dark color only, so the rendered CSS in the browser is:

border-bottom: 1px solid var(--lightningcss-dark,var(--wcom-c-outline-variant-dark));

I also checked, and the normal color-rule correctly applies the light and dark colors, so I suppose, border-bottom is not transpiled correctly.

I fixed this, by defining an extra var right before usage:

--border-color: light-dark(
    var(--wcom-c-outline-variant-light),
    var(--wcom-c-outline-variant-dark)
);
border-bottom: 1px solid var(--border-color);

I hope this can help trouble shooting the issue. About my project infrastructure (only partially listed deps):

"dependencies": {
    "next": "^14.2.14",
    "postcss": "^8.4.47",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "sass": "^1.79.4",
},

and experimental.useLightningcss is enabled in next.config.js

@fmacherey
Copy link
Author

Additional info: color and background-color are transpiled correctly, but border-bottom and also the other border-rules not.

@devongovett
Copy link
Member

I'm not seeing that in the playground. Or maybe I'm not understanding the issue.

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

No branches or pull requests

5 participants
@devongovett @fmacherey and others