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

bug: Fallback colors don't use opacity like oklch #2712

Closed
kriskratz opened this issue Dec 29, 2023 · 1 comment
Closed

bug: Fallback colors don't use opacity like oklch #2712

kriskratz opened this issue Dec 29, 2023 · 1 comment

Comments

@kriskratz
Copy link

kriskratz commented Dec 29, 2023

What version of daisyUI are you using?

4.4.23

Which browsers are you seeing the problem on?

All old browsers

Reproduction URL

https://arobotcandream.com/wordpress-change-favicon-site-logo-with-full-site-editor-fse-theme/

Describe your issue

Fallback colors can't use opacity the way they are set, so they don't display correctly in older browsers. And the fallback color for code blocks (--fallback-bc) doesn't seem to work at all in Safari v12.5 on my old iPhone 6.

Here is an example from the generated CSS. Browsers using fallback colors will see a nearly black background for code blocks, and modern browsers will see that color at 10% opacity. In this case its defined, --fallback-bc: #1f2937

.prose :where(code):not(:where([class~="not-prose"] *)){
  padding: 1px 8px;
  border-radius: var(--rounded-badge);
  background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
  font-weight: initial;
}

This is what it looks like with the Light theme

Screenshot 45

Would separating the fallback background onto another line work instead? And fallback colors can be defined in rgb instead --fallback-bc: 88, 0, 5;

.prose :where(code):not(:where([class~="not-prose"] *)){
  padding: 1px 8px;
  border-radius: var(--rounded-badge);
  background-color: rgb(var(--falback-bc), 0.1);
  background-color: oklch(var(--bc)/0.1);
  font-weight: initial;
}

This is what I expect:

Screenshot 46

Copy link

Thank you @kriskratz for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

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

1 participant