|
|
@@ -2,12 +2,15 @@
|
|
|
<label :class="{ filled }" :for="id">
|
|
|
<input :id="id" type="checkbox" v-model="checked" />
|
|
|
<span>{{ label }}</span>
|
|
|
- <span v-if="help" class="help" :aria-label="help"><i class="material-icons">info</i></span>
|
|
|
+ <span v-if="help" class="tooltiped tooltiped--medium" :aria-tooltip="help"
|
|
|
+ ><i class="material-icons">info</i></span
|
|
|
+ >
|
|
|
</label>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
import { defineComponent } from "vue";
|
|
|
+import "@/assets/css/tooltip.css";
|
|
|
|
|
|
export default defineComponent({
|
|
|
data() {
|
|
|
@@ -98,51 +101,13 @@ input[type="checkbox"]:checked {
|
|
|
width: 8px;
|
|
|
height: 14px;
|
|
|
}
|
|
|
-.help .material-icons {
|
|
|
+.tooltiped .material-icons {
|
|
|
vertical-align: text-top;
|
|
|
font-size: 1em;
|
|
|
}
|
|
|
-.help {
|
|
|
- font-size: 1em;
|
|
|
+.tooltiped {
|
|
|
color: var(--color-accent-400);
|
|
|
position: relative;
|
|
|
margin-left: 4px;
|
|
|
}
|
|
|
-.help::after,
|
|
|
-.help::before {
|
|
|
- pointer-events: none;
|
|
|
- transition: all 0.18s ease-out 0.18s;
|
|
|
- position: absolute;
|
|
|
- z-index: 10;
|
|
|
- bottom: 100%;
|
|
|
- left: 50%;
|
|
|
- transform-origin: top;
|
|
|
- transform: translate(-50%, 4px);
|
|
|
- opacity: 0;
|
|
|
-}
|
|
|
-.help::after {
|
|
|
- content: attr(aria-label);
|
|
|
- background: var(--color-neutral-200);
|
|
|
- padding: 0.5em 1em;
|
|
|
- border-radius: 4px;
|
|
|
- color: #fff;
|
|
|
- line-height: 1em;
|
|
|
- font-weight: normal;
|
|
|
- white-space: normal;
|
|
|
- width: 160px;
|
|
|
- text-align: center;
|
|
|
- margin-bottom: 10px;
|
|
|
-}
|
|
|
-.help::before {
|
|
|
- content: "";
|
|
|
- width: 0;
|
|
|
- height: 0;
|
|
|
- border: 5px solid transparent;
|
|
|
- border-top-color: var(--color-neutral-200);
|
|
|
-}
|
|
|
-.help:hover::before,
|
|
|
-.help:hover::after {
|
|
|
- transform: translate(-50%, 0);
|
|
|
- opacity: 1;
|
|
|
-}
|
|
|
</style>
|