Skip to content

Instantly share code, notes, and snippets.

@spaquet
Last active January 18, 2022 19:12
Show Gist options
  • Save spaquet/53990f614d79de229f021fa7e6985cd3 to your computer and use it in GitHub Desktop.
Save spaquet/53990f614d79de229f021fa7e6985cd3 to your computer and use it in GitHub Desktop.
Rails Popper Stimulus Stylesheet
#tooltip {
background: #333;
color: white;
font-weight: bold;
padding: 4px 8px;
font-size: 13px;
border-radius: 4px;
display: none;
}
#arrow,
#arrow::before {
position: absolute;
width: 8px;
height: 8px;
background: inherit;
}
#arrow {
visibility: hidden;
}
#arrow::before {
visibility: visible;
content: "";
transform: rotate(45deg);
}
#tooltip[data-popper-placement^="top"] > #arrow {
bottom: -4px;
}
#tooltip[data-popper-placement^="bottom"] > #arrow {
top: -4px;
}
#tooltip[data-popper-placement^="left"] > #arrow {
right: -4px;
}
#tooltip[data-popper-placement^="right"] > #arrow {
left: -4px;
}
#tooltip[data-show] {
display: block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment