react-jam-ui
Version:
React JAM UI components
190 lines (182 loc) • 3.83 kB
text/stylus
$default = json('default.json', { hash: true });
$custom = json('../../../../ui.config.json', { hash: true, optional: true });
$tooltips = typeof($custom) != 'null' ? $custom.$tooltips : $default.$tooltips;
@import 'themes/default.styl';
.tooltip {
position: relative;
.tooltip-text {
position: absolute;
display: none;
padding: 5px 13px;
z-index: 110;
max-width: 250px;
font-size: 0.75rem;
}
&:hover {
.tooltip-text {
display: block;
}
}
&&-x-left {
.tooltip-text {
right: 100%;
margin-right: 15px;
}
}
&&-x-center {
.tooltip-text {
left: 50%;
transform: translateX(-50%);
}
}
&&-x-right {
.tooltip-text {
left: 100%;
margin-left: 15px;
}
}
&&-y-top {
.tooltip-text {
bottom: 100%;
margin-bottom: 15px;
}
}
&&-y-center {
.tooltip-text {
top: 50%;
transform: translateY(-50%);
}
}
&&-y-bottom {
.tooltip-text {
top: 100%;
margin-top: 15px;
}
}
for type, params in $tooltips {
if (type == 'default') {
& {
define('name', params.theme)
tooltip-{name}(params)
}
} else {
&.tooltip-{type} {
define('name', params.theme)
tooltip-{name}(params)
}
}
}
}
/*
.tooltip {
position: absolute;
z-index: 1070;
display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 1.42857143;
text-align: left;
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
letter-spacing: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
white-space: normal;
opacity: 0;
line-break: auto
}
.tooltip.in {
opacity: .9
}
.tooltip.top {
padding: 5px 0;
margin-top: -3px
}
.tooltip.right {
padding: 0 5px;
margin-left: 3px
}
.tooltip.bottom {
padding: 5px 0;
margin-top: 3px
}
.tooltip.left {
padding: 0 5px;
margin-left: -3px
}
.tooltip-inner {
max-width: 200px;
padding: 3px 8px;
color: #fff;
text-align: center;
background-color: #000;
border-radius: 4px
}
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid
}
.tooltip.top .tooltip-arrow {
bottom: 0;
left: 50%;
margin-left: -5px;
border-width: 5px 5px 0;
border-top-color: #000
}
.tooltip.top-left .tooltip-arrow {
right: 5px;
bottom: 0;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000
}
.tooltip.top-right .tooltip-arrow {
bottom: 0;
left: 5px;
margin-bottom: -5px;
border-width: 5px 5px 0;
border-top-color: #000
}
.tooltip.right .tooltip-arrow {
top: 50%;
left: 0;
margin-top: -5px;
border-width: 5px 5px 5px 0;
border-right-color: #000
}
.tooltip.left .tooltip-arrow {
top: 50%;
right: 0;
margin-top: -5px;
border-width: 5px 0 5px 5px;
border-left-color: #000
}
.tooltip.bottom .tooltip-arrow {
top: 0;
left: 50%;
margin-left: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000
}
.tooltip.bottom-left .tooltip-arrow {
top: 0;
right: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000
}
.tooltip.bottom-right .tooltip-arrow {
top: 0;
left: 5px;
margin-top: -5px;
border-width: 0 5px 5px;
border-bottom-color: #000
} */