mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-21 01:15:35 +00:00
253 lines
8.5 KiB
SCSS
253 lines
8.5 KiB
SCSS
/* -------------------------------------------------------------------
|
|
Microtip
|
|
|
|
Modern, lightweight css-only tooltips
|
|
Just 1kb minified and gzipped
|
|
|
|
@author Ghosh
|
|
@package Microtip
|
|
|
|
----------------------------------------------------------------------
|
|
1. Base Styles
|
|
2. Direction Modifiers
|
|
3. Position Modifiers
|
|
-------------------------------------------------------------------- */
|
|
|
|
/* ------------------------------------------------
|
|
[1] Base Styles
|
|
------------------------------------------------- */
|
|
|
|
.uppy-Root [aria-label][role~='tooltip'] {
|
|
position: relative;
|
|
}
|
|
|
|
.uppy-Root [aria-label][role~='tooltip']::before,
|
|
.uppy-Root [aria-label][role~='tooltip']::after {
|
|
position: absolute;
|
|
z-index: 10;
|
|
box-sizing: border-box;
|
|
transform: translate3d(0, 0, 0);
|
|
transform-origin: top;
|
|
-webkit-backface-visibility: hidden;
|
|
backface-visibility: hidden;
|
|
opacity: 0;
|
|
transition: all var(--microtip-transition-duration, 0.18s)
|
|
var(--microtip-transition-easing, ease-in-out)
|
|
var(--microtip-transition-delay, 0s);
|
|
pointer-events: none;
|
|
will-change: transform;
|
|
}
|
|
|
|
.uppy-Root [aria-label][role~='tooltip']::before {
|
|
background-size: 100% auto !important;
|
|
content: '';
|
|
}
|
|
|
|
.uppy-Root [aria-label][role~='tooltip']::after {
|
|
box-sizing: content-box;
|
|
padding: 0.5em 1em;
|
|
color: #fff;
|
|
font-weight: var(--microtip-font-weight, normal);
|
|
font-size: var(--microtip-font-size, 13px);
|
|
white-space: nowrap;
|
|
text-transform: var(--microtip-text-transform, none);
|
|
background: rgba(17, 17, 17, 0.9);
|
|
border-radius: 4px;
|
|
content: attr(aria-label);
|
|
}
|
|
|
|
.uppy-Root [aria-label][role~='tooltip']:hover::before,
|
|
.uppy-Root [aria-label][role~='tooltip']:hover::after,
|
|
.uppy-Root [aria-label][role~='tooltip']:focus::before,
|
|
.uppy-Root [aria-label][role~='tooltip']:focus::after {
|
|
opacity: 1;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[2] Position Modifiers
|
|
------------------------------------------------- */
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position|='top']::before {
|
|
bottom: 100%;
|
|
left: 50%;
|
|
width: 18px;
|
|
height: 6px;
|
|
margin-bottom: 5px;
|
|
background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E')
|
|
no-repeat;
|
|
transform: translate3d(-50%, 0, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position|='top']::after {
|
|
bottom: 100%;
|
|
left: 50%;
|
|
margin-bottom: 11px;
|
|
transform: translate3d(-50%, 0, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position|='top']:hover::before {
|
|
transform: translate3d(-50%, -5px, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='top']:hover::after {
|
|
transform: translate3d(-50%, -5px, 0);
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[2.1] Top Left
|
|
------------------------------------------------- */
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='top-left']::after {
|
|
bottom: 100%;
|
|
transform: translate3d(calc(-100% + 16px), 0, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='top-left']:hover::after {
|
|
transform: translate3d(calc(-100% + 16px), -5px, 0);
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[2.2] Top Right
|
|
------------------------------------------------- */
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='top-right']::after {
|
|
bottom: 100%;
|
|
transform: translate3d(calc(0% + -16px), 0, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='top-right']:hover::after {
|
|
transform: translate3d(calc(0% + -16px), -5px, 0);
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[2.3] Bottom
|
|
------------------------------------------------- */
|
|
.uppy-Root [role~='tooltip'][data-microtip-position|='bottom']::before {
|
|
top: 100%;
|
|
bottom: auto;
|
|
left: 50%;
|
|
width: 18px;
|
|
height: 6px;
|
|
margin-top: 5px;
|
|
margin-bottom: 0;
|
|
background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E')
|
|
no-repeat;
|
|
transform: translate3d(-50%, -10px, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position|='bottom']::after {
|
|
top: 100%;
|
|
left: 50%;
|
|
margin-top: 11px;
|
|
transform: translate3d(-50%, -10px, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position|='bottom']:hover::before {
|
|
transform: translate3d(-50%, 0, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='bottom']:hover::after {
|
|
transform: translate3d(-50%, 0, 0);
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[2.4] Bottom Left
|
|
------------------------------------------------- */
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='bottom-left']::after {
|
|
top: 100%;
|
|
transform: translate3d(calc(-100% + 16px), -10px, 0);
|
|
}
|
|
|
|
.uppy-Root
|
|
[role~='tooltip'][data-microtip-position='bottom-left']:hover::after {
|
|
transform: translate3d(calc(-100% + 16px), 0, 0);
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[2.5] Bottom Right
|
|
------------------------------------------------- */
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='bottom-right']::after {
|
|
top: 100%;
|
|
transform: translate3d(calc(0% + -16px), -10px, 0);
|
|
}
|
|
|
|
.uppy-Root
|
|
[role~='tooltip'][data-microtip-position='bottom-right']:hover::after {
|
|
transform: translate3d(calc(0% + -16px), 0, 0);
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[2.6] Left
|
|
------------------------------------------------- */
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='left']::before,
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='left']::after {
|
|
top: 50%;
|
|
right: 100%;
|
|
bottom: auto;
|
|
left: auto;
|
|
transform: translate3d(10px, -50%, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='left']::before {
|
|
width: 6px;
|
|
height: 18px;
|
|
margin-right: 5px;
|
|
margin-bottom: 0;
|
|
background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E')
|
|
no-repeat;
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='left']::after {
|
|
margin-right: 11px;
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='left']:hover::before,
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='left']:hover::after {
|
|
transform: translate3d(0, -50%, 0);
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[2.7] Right
|
|
------------------------------------------------- */
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='right']::before,
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='right']::after {
|
|
top: 50%;
|
|
bottom: auto;
|
|
left: 100%;
|
|
transform: translate3d(-10px, -50%, 0);
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='right']::before {
|
|
width: 6px;
|
|
height: 18px;
|
|
margin-bottom: 0;
|
|
margin-left: 5px;
|
|
background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E')
|
|
no-repeat;
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='right']::after {
|
|
margin-left: 11px;
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='right']:hover::before,
|
|
.uppy-Root [role~='tooltip'][data-microtip-position='right']:hover::after {
|
|
transform: translate3d(0, -50%, 0);
|
|
}
|
|
|
|
/* ------------------------------------------------
|
|
[3] Size
|
|
------------------------------------------------- */
|
|
.uppy-Root [role~='tooltip'][data-microtip-size='small']::after {
|
|
width: 80px;
|
|
white-space: initial;
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-size='medium']::after {
|
|
width: 150px;
|
|
white-space: initial;
|
|
}
|
|
|
|
.uppy-Root [role~='tooltip'][data-microtip-size='large']::after {
|
|
width: 260px;
|
|
white-space: initial;
|
|
}
|