Commit 5c0246cf authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

feat: outline tooltips (#3230)

parent ee32418f
...@@ -11,6 +11,7 @@ export const BoundaryProvider = BoundaryContext.Provider ...@@ -11,6 +11,7 @@ export const BoundaryProvider = BoundaryContext.Provider
const PopoverContainer = styled.div<{ show: boolean }>` const PopoverContainer = styled.div<{ show: boolean }>`
background-color: ${({ theme }) => theme.dialog}; background-color: ${({ theme }) => theme.dialog};
border: 1px solid ${({ theme }) => theme.outline};
border-radius: 0.5em; border-radius: 0.5em;
opacity: ${(props) => (props.show ? 1 : 0)}; opacity: ${(props) => (props.show ? 1 : 0)};
padding: 8px; padding: 8px;
...@@ -23,8 +24,6 @@ const Reference = styled.div` ...@@ -23,8 +24,6 @@ const Reference = styled.div`
display: inline-block; display: inline-block;
` `
const SQRT_8 = Math.sqrt(8)
const Arrow = styled.div` const Arrow = styled.div`
height: 8px; height: 8px;
width: 8px; width: 8px;
...@@ -32,6 +31,7 @@ const Arrow = styled.div` ...@@ -32,6 +31,7 @@ const Arrow = styled.div`
::before { ::before {
background: ${({ theme }) => theme.dialog}; background: ${({ theme }) => theme.dialog};
border: 1px solid ${({ theme }) => theme.outline};
content: ''; content: '';
height: 8px; height: 8px;
position: absolute; position: absolute;
...@@ -40,30 +40,38 @@ const Arrow = styled.div` ...@@ -40,30 +40,38 @@ const Arrow = styled.div`
} }
&.arrow-top { &.arrow-top {
bottom: -${SQRT_8}px; bottom: -4px;
::before { ::before {
border-bottom-right-radius: 1px; border-radius: 1px;
border-left: none;
border-top: none;
} }
} }
&.arrow-bottom { &.arrow-bottom {
top: -${SQRT_8}px; top: -5px; // includes -1px from border
::before { ::before {
border-top-left-radius: 1px; border-bottom: none;
border-right: none;
border-radius: 1px;
} }
} }
&.arrow-left { &.arrow-left {
right: -${SQRT_8}px; right: -4px;
::before { ::before {
border-top-right-radius: 1px; border-bottom: none;
border-left: none;
border-radius: 1px;
} }
} }
&.arrow-right { &.arrow-right {
left: -${SQRT_8}px; left: -5px; // includes -1px from border
::before { ::before {
border-bottom-left-radius: 1px; border-radius: 1px;
border-right: none;
border-top: none;
} }
} }
` `
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment