ui(feat): Adds light/dark mode support for viewport overlay text and markers (#5041)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
1fd39626e7
commit
04ab79f8fb
63 files changed
+65
-38
No files matched your search
@@ -7,7 +7,6 @@
|
||||
.ViewportOverlay .overlay-element {
|
||||
position: absolute;
|
||||
font-weight: 400;
|
||||
text-shadow: 1px 1px #000;
|
||||
pointer-events: none;
|
||||
}
|
||||
.overlay-top {
|
||||
@@ -17,6 +16,17 @@
|
||||
bottom: 2.15rem;
|
||||
}
|
||||
|
||||
/* Base text styling without shadow */
|
||||
.overlay-text {
|
||||
/* No default shadow - will be applied by shadow classes */
|
||||
}
|
||||
|
||||
/* Dark shadow for light backgrounds */
|
||||
.shadow-dark {
|
||||
text-shadow: 0.8px 0.8px 0.5px rgba(0, 0, 0, 0.65);
|
||||
}
|
||||
|
||||
/* Light shadow for dark backgrounds */
|
||||
.shadow-light {
|
||||
text-shadow: 0.8px 0.8px 0.5px rgba(255, 255, 255, 0.65);
|
||||
}
|
||||
@@ -17,11 +17,11 @@ const classes = {
|
||||
bottomLeft: 'overlay-bottom left-viewport',
|
||||
};
|
||||
|
||||
function ViewportOverlay({ topLeft, topRight, bottomRight, bottomLeft, color = 'text-highlight' }) {
|
||||
function ViewportOverlay({ topLeft, topRight, bottomRight, bottomLeft, color = 'text-highlight', shadowClass = 'shadow-dark' }) {
|
||||
const overlay = 'absolute pointer-events-none viewport-overlay';
|
||||
|
||||
return (
|
||||
<div className={classNames(color, 'overlay-text text-base leading-5')}>
|
||||
<div className={classNames(color, 'overlay-text', shadowClass, 'text-base leading-5')}>
|
||||
<div
|
||||
data-cy="viewport-overlay-top-left"
|
||||
className={classNames(overlay, classes.topLeft)}
|
||||
@@ -58,6 +58,7 @@ ViewportOverlay.propTypes = {
|
||||
bottomRight: PropTypes.node,
|
||||
bottomLeft: PropTypes.node,
|
||||
color: PropTypes.string,
|
||||
shadowClass: PropTypes.string,
|
||||
};
|
||||
|
||||
export { ViewportOverlay };
|
||||
export { ViewportOverlay };
|
||||
Reference in new issue
Block a user