-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tooltip combined positions, tooltip offset
- Loading branch information
1 parent
5dd7675
commit e96e628
Showing
7 changed files
with
156 additions
and
26 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
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
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 |
---|---|---|
@@ -1,62 +1,130 @@ | ||
.mappable--tooltip-marker { | ||
--tail-height: 12px; | ||
--tail-width: 16px; | ||
--border-radius: 12px; | ||
|
||
--tail-height-and-offset: calc(var(--tail-height) + var(--offset)); | ||
|
||
--tooltip-tail-transform-top: translate(-50%, calc(-100% - var(--offset))) rotate(180deg); | ||
--tooltip-tail-transform-bottom: translate(-50%, var(--offset)); | ||
} | ||
|
||
.mappable--tooltip-marker svg { | ||
display: block; | ||
} | ||
|
||
.mappable--tooltip-marker_container { | ||
box-sizing: border-box; | ||
width: max-content; | ||
max-width: 500px; | ||
max-height: 600px; | ||
display: block; | ||
position: absolute; | ||
padding: 8px 12px; | ||
border-radius: 12px; | ||
border-radius: var(--border-radius); | ||
background-color: #fff; | ||
color: #34374a; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 20px; | ||
box-shadow: 0px 4px 12px 0px #5f69831a; | ||
box-shadow: | ||
0px 4px 12px 0px #5f69831a, | ||
0px 4px 24px 0px #5f69830a; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.mappable--tooltip-marker_tail { | ||
display: block; | ||
position: absolute; | ||
color: #fff; | ||
box-shadow: 0px 4px 24px 0px #5f69830a; | ||
|
||
svg { | ||
filter: drop-shadow(0px 4px 24px rgba(95, 105, 131, 0.04)) drop-shadow(0px 4px 12px rgba(95, 105, 131, 0.1)); | ||
} | ||
} | ||
|
||
/* positions */ | ||
.position-top { | ||
.mappable--tooltip-marker_container { | ||
transform: translate(-50%, calc(-100% - var(--tail-height))); | ||
transform: translate(-50%, calc(-100% - var(--tail-height-and-offset))); | ||
} | ||
.mappable--tooltip-marker_tail { | ||
transform: translate(-50%, -100%) rotate(180deg); | ||
transform: var(--tooltip-tail-transform-top); | ||
} | ||
/* top left */ | ||
&.position-left { | ||
.mappable--tooltip-marker_container { | ||
transform: translate( | ||
calc(-100% + var(--border-radius) + var(--tail-width) / 2), | ||
calc(-100% - var(--tail-height-and-offset)) | ||
); | ||
} | ||
.mappable--tooltip-marker_tail { | ||
transform: var(--tooltip-tail-transform-top); | ||
} | ||
} | ||
/* top right */ | ||
&.position-right { | ||
.mappable--tooltip-marker_container { | ||
transform: translate( | ||
calc(-1 * var(--border-radius) - var(--tail-width) / 2), | ||
calc(-100% - var(--tail-height-and-offset)) | ||
); | ||
} | ||
.mappable--tooltip-marker_tail { | ||
transform: var(--tooltip-tail-transform-top); | ||
} | ||
} | ||
} | ||
|
||
.position-bottom { | ||
.mappable--tooltip-marker_container { | ||
transform: translate(-50%, var(--tail-height)); | ||
transform: translate(-50%, var(--tail-height-and-offset)); | ||
} | ||
.mappable--tooltip-marker_tail { | ||
transform: translate(-50%, 0); | ||
transform: var(--tooltip-tail-transform-bottom); | ||
} | ||
/* bottom left */ | ||
&.position-left { | ||
.mappable--tooltip-marker_container { | ||
transform: translate( | ||
calc(-100% + var(--border-radius) + var(--tail-width) / 2), | ||
var(--tail-height-and-offset) | ||
); | ||
} | ||
.mappable--tooltip-marker_tail { | ||
transform: var(--tooltip-tail-transform-bottom); | ||
} | ||
} | ||
/* bottom right */ | ||
&.position-right { | ||
.mappable--tooltip-marker_container { | ||
transform: translate( | ||
calc(-1 * var(--border-radius) - var(--tail-width) / 2), | ||
var(--tail-height-and-offset) | ||
); | ||
} | ||
.mappable--tooltip-marker_tail { | ||
transform: var(--tooltip-tail-transform-bottom); | ||
} | ||
} | ||
} | ||
|
||
.position-left { | ||
.mappable--tooltip-marker_container { | ||
transform: translate(calc(-100% - var(--tail-height)), -50%); | ||
transform: translate(calc(-100% - var(--tail-height-and-offset)), -50%); | ||
} | ||
.mappable--tooltip-marker_tail { | ||
transform: translate(-100%, -50%) rotate(90deg); | ||
transform: translate(calc(-100% - var(--offset)), -50%) rotate(90deg); | ||
} | ||
} | ||
|
||
.position-right { | ||
.mappable--tooltip-marker_container { | ||
transform: translate(var(--tail-height), -50%); | ||
transform: translate(var(--tail-height-and-offset), -50%); | ||
} | ||
.mappable--tooltip-marker_tail { | ||
transform: translate(0, -50%) rotate(-90deg); | ||
transform: translate(var(--offset), -50%) rotate(-90deg); | ||
} | ||
} |
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