-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve styles for overlay (#4576)
- Loading branch information
1 parent
d440baf
commit 791fb85
Showing
5 changed files
with
2,446 additions
and
761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// styles are inspired by `react-error-overlay` | ||
|
||
const msgStyles = { | ||
error: { | ||
backgroundColor: "rgba(206, 17, 38, 0.1)", | ||
color: "#fccfcf", | ||
}, | ||
warning: { | ||
backgroundColor: "rgba(251, 245, 180, 0.1)", | ||
color: "#fbf5b4", | ||
}, | ||
}; | ||
|
||
const iframeStyle = { | ||
position: "fixed", | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
width: "100vw", | ||
height: "100vh", | ||
border: "none", | ||
"z-index": 9999999999, | ||
}; | ||
|
||
const containerStyle = { | ||
position: "fixed", | ||
boxSizing: "border-box", | ||
left: 0, | ||
top: 0, | ||
right: 0, | ||
bottom: 0, | ||
width: "100vw", | ||
height: "100vh", | ||
fontSize: "large", | ||
padding: "2rem 2rem 4rem 2rem", | ||
lineHeight: "1.2", | ||
whiteSpace: "pre-wrap", | ||
overflow: "auto", | ||
backgroundColor: "rgba(0, 0, 0, 0.9)", | ||
color: "white", | ||
}; | ||
|
||
const headerStyle = { | ||
color: "#e83b46", | ||
fontSize: "2em", | ||
whiteSpace: "pre-wrap", | ||
fontFamily: "sans-serif", | ||
margin: "0 2rem 2rem 0", | ||
flex: "0 0 auto", | ||
maxHeight: "50%", | ||
overflow: "auto", | ||
}; | ||
|
||
const dismissButtonStyle = { | ||
color: "#ffffff", | ||
lineHeight: "1rem", | ||
fontSize: "1.5rem", | ||
padding: "1rem", | ||
cursor: "pointer", | ||
position: "absolute", | ||
right: 0, | ||
top: 0, | ||
backgroundColor: "transparent", | ||
border: "none", | ||
}; | ||
|
||
const msgTypeStyle = { | ||
color: "#e83b46", | ||
fontSize: "1.2em", | ||
marginBottom: "1rem", | ||
fontFamily: "sans-serif", | ||
}; | ||
|
||
const msgTextStyle = { | ||
lineHeight: "1.5", | ||
fontSize: "1rem", | ||
fontFamily: "Menlo, Consolas, monospace", | ||
}; | ||
|
||
export { | ||
msgStyles, | ||
iframeStyle, | ||
containerStyle, | ||
headerStyle, | ||
dismissButtonStyle, | ||
msgTypeStyle, | ||
msgTextStyle, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.