Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador Video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
IIIF
Mirador
Mirador Video
Commits
7f9a0d70
Unverified
Commit
7f9a0d70
authored
Dec 13, 2023
by
Justin Coyne
Committed by
GitHub
Dec 13, 2023
Browse files
Options
Downloads
Plain Diff
Merge pull request #3857 from ProjectMirador/mui5-dark-mode
Fix dark mode issues with the collection dialog
parents
7c0af085
a9e082e2
Branches
Branches containing commit
No related tags found
2 merge requests
!19
Draft: Merge video support into mui5
,
!18
Only nudge over badge content for the WindowListButton; it needs special...
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/CollectionDialog.js
+3
-0
3 additions, 0 deletions
src/components/CollectionDialog.js
src/components/ScrollIndicatedDialogContent.js
+42
-19
42 additions, 19 deletions
src/components/ScrollIndicatedDialogContent.js
with
45 additions
and
19 deletions
src/components/CollectionDialog.js
+
3
−
0
View file @
7f9a0d70
...
...
@@ -25,6 +25,9 @@ const StyledScrollIndicatedDialogContent = styled(ScrollIndicatedDialogContent)(
}));
const
StyledCollectionMetadata
=
styled
(
'
div
'
)(()
=>
({
'
& .MuiPaper-root
'
:
{
background
:
'
transparent
'
,
},
padding
:
(
theme
)
=>
theme
.
spacing
(
2
),
}));
...
...
This diff is collapsed.
Click to expand it.
src/components/ScrollIndicatedDialogContent.js
+
42
−
19
View file @
7f9a0d70
import
PropTypes
from
'
prop-types
'
;
import
DialogContent
from
'
@mui/material/DialogContent
'
;
import
{
styled
}
from
'
@mui/material/styles
'
;
import
{
alpha
,
styled
}
from
'
@mui/material/styles
'
;
const
Root
=
styled
(
DialogContent
,
{
name
:
'
ScrollIndicatedDialogContent
'
,
slot
:
'
root
'
})(({
theme
})
=>
({
/**
* From https://github.com/mui/material-ui/blob/v5.15.0/packages/mui-material/src/styles/getOverlayAlpha.ts
*/
const
getOverlayAlpha
=
(
elevation
)
=>
{
let
alphaValue
;
if
(
elevation
<
1
)
{
alphaValue
=
5.11916
*
elevation
**
2
;
}
else
{
alphaValue
=
4.5
*
Math
.
log
(
elevation
+
1
)
+
2
;
}
return
(
alphaValue
/
100
).
toFixed
(
2
);
};
const
Root
=
styled
(
DialogContent
,
{
name
:
'
ScrollIndicatedDialogContent
'
,
slot
:
'
root
'
})(({
ownerState
,
theme
})
=>
{
// In dark mode, paper has a elevation-dependent background color:
// https://github.com/mui/material-ui/blob/v5.15.0/packages/mui-material/src/Paper/Paper.js#L55-L60
const
bgcolor
=
theme
.
palette
.
mode
===
'
dark
'
?
{
backgroundImage
:
`linear-gradient(
${
alpha
(
'
#fff
'
,
getOverlayAlpha
(
ownerState
?.
elevation
||
24
),
)}
,
${
alpha
(
'
#fff
'
,
getOverlayAlpha
(
ownerState
?.
elevation
||
24
))}
)`
,
}
:
theme
.
palette
.
background
.
paper
;
return
{
/* Shadow covers */
background
:
`linear-gradient(
${
theme
.
palette
.
background
.
pape
r
}
30%, rgba(255, 255, 255, 0)), `
+
`linear-gradient(rgba(255, 255, 255, 0),
${
theme
.
palette
.
background
.
pape
r
}
70%) 0 100%, `
background
:
`linear-gradient(
${
bgcolo
r
}
30%, rgba(255, 255, 255, 0)), `
+
`linear-gradient(rgba(255, 255, 255, 0),
${
bgcolo
r
}
70%) 0 100%, `
// Shaddows
+
'
radial-gradient(50% 0, farthest-side, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)),
'
+
'
radial-gradient(50% 100%, farthest-side, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%,
'
,
/* Shadow covers */
background
:
`linear-gradient(
${
theme
.
palette
.
background
.
pape
r
}
30%, rgba(255, 255, 255, 0)), `
// eslint-disable-line no-dupe-keys
+
`linear-gradient(rgba(255, 255, 255, 0),
${
theme
.
palette
.
background
.
pape
r
}
70%) 0 100%, `
background
:
`linear-gradient(
${
bgcolo
r
}
30%, rgba(255, 255, 255, 0)), `
// eslint-disable-line no-dupe-keys
+
`linear-gradient(rgba(255, 255, 255, 0),
${
bgcolo
r
}
70%) 0 100%, `
// Shaddows
+
'
radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)),
'
+
'
radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%;
'
,
...
...
@@ -20,7 +42,8 @@ const Root = styled(DialogContent, { name: 'ScrollIndicatedDialogContent', slot:
backgroundRepeat
:
'
no-repeat
'
,
backgroundSize
:
'
100% 40px, 100% 40px, 100% 14px, 100% 14px
'
,
overflowY
:
'
auto
'
,
}));
};
});
/**
* ScrollIndicatedDialogContent ~ Inject a style into the DialogContent component
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment