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

[TreeView] Fix alpha usage with CSS variables #14969

Merged
merged 6 commits into from
Oct 16, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,32 @@ const TreeItem2DragAndDropOverlayRoot = styled('div', {
style: {
marginLeft: 'calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))',
borderRadius: theme.shape.borderRadius,
backgroundColor: alpha((theme.vars || theme).palette.primary.dark, 0.15),
backgroundColor: theme.vars
? `rgba(${theme.vars.palette.primary.dark} / ${0.15})`
: alpha(theme.palette.primary.dark, 0.15),
},
},
{
props: { action: 'reorder-above' },
style: {
marginLeft: 'calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))',
borderTop: `1px solid ${alpha((theme.vars || theme).palette.grey[900], 0.6)}`,
borderTop: theme.vars
? `1px solid rgba(${theme.vars.palette.grey[900]} / ${0.6})`
: `1px solid ${alpha(theme.palette.grey[900], 0.6)}`,
...theme.applyStyles('dark', {
borderTopColor: alpha((theme.vars || theme).palette.grey[100], 0.6),
borderTopColor: theme.vars ? `rgba(${theme.vars.palette.grey[100]} / ${0.6})` : alpha(theme.palette.grey[100], 0.6),
LukasTy marked this conversation as resolved.
Show resolved Hide resolved
}),
},
},
{
props: { action: 'reorder-below' },
style: {
marginLeft: 'calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))',
borderBottom: `1px solid ${alpha((theme.vars || theme).palette.grey[900], 0.6)}`,
borderBottom: theme.vars
? `1px solid rgba(${theme.vars.palette.grey[900]} / ${0.6})`
: `1px solid ${alpha(theme.palette.grey[900], 0.6)}`,
...theme.applyStyles('dark', {
borderBottomColor: alpha((theme.vars || theme).palette.grey[100], 0.6),
borderBottomColor: theme.vars ? `rgba(${theme.vars.palette.grey[100]} / ${0.6})` : alpha(theme.palette.grey[100], 0.6),
LukasTy marked this conversation as resolved.
Show resolved Hide resolved
}),
},
},
Expand All @@ -52,9 +58,11 @@ const TreeItem2DragAndDropOverlayRoot = styled('div', {
style: {
marginLeft:
'calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))' as any,
borderBottom: `1px solid ${alpha((theme.vars || theme).palette.grey[900], 0.6)}`,
borderBottom: theme.vars
? `1px solid rgba(${theme.vars.palette.grey[900]} / ${0.6})`
: `1px solid ${alpha(theme.palette.grey[900], 0.6)}`,
...theme.applyStyles('dark', {
borderBottomColor: alpha((theme.vars || theme).palette.grey[900], 0.6),
borderBottomColor: theme.vars ? `rgba(${theme.vars.palette.grey[900]} / ${0.6})` : alpha(theme.palette.grey[900], 0.6),
Copy link
Member

Choose a reason for hiding this comment

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

@flaviendelangle @noraleonte could you double check if this is not an error? 🤔
It seems that this should maybe use grey[100] as in all other cases for the dark theme. 🤔
Now it does nothing... 🤷

LukasTy marked this conversation as resolved.
Show resolved Hide resolved
}),
},
},
Expand Down