Created
January 21, 2014 05:44
-
-
Save hachibeeDI/8534958 to your computer and use it in GitHub Desktop.
stylus mix-in for widgets
This file contains hidden or 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
// require: npm install nib | |
@import 'nib/vendor' | |
support-for-ie = false // disable old browser support | |
topstand-triangle() | |
width: 0 | |
height: 0 | |
border-top: 25px solid bg-color | |
border-left: 20px solid transparent | |
border-right: 20px solid transparent | |
tooltip(bg-color, fg-color) | |
display: inline | |
position: relative | |
text-decoration: none | |
&:after | |
content: attr(data-tooltip) | |
position: absolute | |
bottom: 135% | |
right: 20% | |
white-space: normal | |
background: bg-color | |
color: fg-color | |
padding: 5px 15px | |
border-radius 3px | |
opacity: 0 | |
transition-property opacity, bottom | |
transition-timing-function ease | |
transition-duration 0.6s | |
&:hover:after | |
opacity: 1 | |
bottom: 120% | |
&:before | |
topstand-triangle() | |
content: "" | |
position: absolute | |
opacity: 0 | |
right: 30% | |
bottom: 90% | |
transition-property opacity, bottom | |
transition-timing-function ease-in | |
transition-duration 0.2s | |
&:hover:before | |
opacity: 1 | |
bottom: 75% | |
// sample | |
.tooltip | |
tooltip(#f13d63, #FEFEFE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment