Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
5c0246cf
Unverified
Commit
5c0246cf
authored
Feb 03, 2022
by
Zach Pomerantz
Committed by
GitHub
Feb 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: outline tooltips (#3230)
parent
ee32418f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
Popover.tsx
src/lib/components/Popover.tsx
+18
-10
No files found.
src/lib/components/Popover.tsx
View file @
5c0246cf
...
@@ -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: -
4
px;
::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: -
4
px;
::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;
}
}
}
}
`
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment