Skip to content

Instantly share code, notes, and snippets.

@paxperscientiam
Created November 16, 2018 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paxperscientiam/73c2327c7bdfc668d351e3701932b8cc to your computer and use it in GitHub Desktop.
Save paxperscientiam/73c2327c7bdfc668d351e3701932b8cc to your computer and use it in GitHub Desktop.
Example of using SCSS for tool-tips (no javascript)
// note that you'll need to edit out variables for this to work. Also, this isn't guaranteed to work!
@mixin moose-tooltip($message) {
position: relative;
display: inline-block;
text-decoration: underline dotted $oc-blue-3;
&::before {
opacity: 0;
}
&:hover::before {
opacity: 1;
font-size: 0.8rem;
content: "ⓘ #{$message}";
position: absolute;
padding: 0.5em;
bottom: 1.5rem;
left: 20px;
max-width: 20em;
white-space: nowrap;
border: 1px solid $black;
border-radius: .5em;
background-color: $white;
box-shadow: 0 0 .2em $dark-gray;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment