Skip to content

Commit

Permalink
V 3/ fallback color mix (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvoskamp authored Sep 11, 2023
1 parent b985a56 commit 5ed7940
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 193 deletions.
71 changes: 37 additions & 34 deletions packages/ui/src/composites/wui-avatar/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,45 @@ export default css`
}
:host([data-variant='generated']) {
--mixed-local-color-1: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-1)
);
--mixed-local-color-2: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-2)
);
--mixed-local-color-3: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-3)
);
--mixed-local-color-4: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-4)
);
--mixed-local-color-5: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-5)
);
--mixed-local-color-1: var(--local-color-1);
--mixed-local-color-2: var(--local-color-2);
--mixed-local-color-3: var(--local-color-3);
--mixed-local-color-4: var(--local-color-4);
--mixed-local-color-5: var(--local-color-5);
}
@supports (background: color-mix(in srgb, white 50%, black)) {
:host([data-variant='generated']) {
--mixed-local-color-1: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-1)
);
--mixed-local-color-2: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-2)
);
--mixed-local-color-3: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-3)
);
--mixed-local-color-4: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-4)
);
--mixed-local-color-5: color-mix(
in srgb,
var(--w3m-color-mix) var(--w3m-color-mix-strength),
var(--local-color-5)
);
}
}
:host([data-variant='generated']) {
outline: 8px solid var(--wui-avatar-border);
background: radial-gradient(
75.29% 75.29% at 64.96% 24.36%,
#fff 0.52%,
var(--local-color-5) 31.25%,
var(--local-color-3) 51.56%,
var(--local-color-2) 65.63%,
var(--local-color-1) 82.29%,
var(--local-color-4) 100%
);
background: radial-gradient(
75.29% 75.29% at 64.96% 24.36%,
#fff 0.52%,
Expand Down
7 changes: 6 additions & 1 deletion packages/ui/src/composites/wui-icon-box/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ export default css`
position: relative;
overflow: hidden;
background-color: var(--wui-gray-glass-020);
background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent);
border-radius: var(--local-border-radius);
border: var(--local-border);
width: var(--local-size);
height: var(--local-size);
min-height: var(--local-size);
min-width: var(--local-size);
}
@supports (background: color-mix(in srgb, white 50%, black)) {
:host {
background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent);
}
}
`
Loading

3 comments on commit 5ed7940

@vercel
Copy link

@vercel vercel bot commented on 5ed7940 Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5ed7940 Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 5ed7940 Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.