I’ve been struggling to reproduce this button :
Specifically I can’t seem to find how to make the border invisible around the check icon. At the moment it’s "finished" except for this part.
It’s a nuxt3 component and it looks like this :
<template>
<div class="button-container">
<nuxt-link :to="link.link">
{{ link.title }}
</nuxt-link>
<div class="check-container">
<svg-icon type="mdi" :path="mdiCheckBold" class="icon is-large" />
</div>
</div>
</template>
<script setup lang="ts">
import { defineProps } from 'vue'
import SvgIcon from '@jamescoyle/vue-icon'
import { mdiCheckBold } from '@mdi/js'
type Link = {
title: string;
link: string;
};
interface Props {
link: Link;
}
defineProps<Props>()
</script>
<style scoped lang="scss">
@import 'assets/style/_variables.scss';
.button-container {
position: relative;
border: dotted $white 0.24rem;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
width: 18rem;
height: 18rem;
a {
text-decoration: none;
color: $white;
font-size: 2rem;
}
.check-container {
position: absolute;
top: 11.5rem;
left: 11.5rem;
border: solid $white 0.24rem;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
width: 7rem;
height: 7rem;
color: $white;
background: $background-gradient;
}
}
</style>
Any help would be great, thank you in advance !
3
Answers
You can use mask to cut part of the border:
An idea of the full code:
A solution to render an halo around the
.check-container
element, that will hide anything behind (see the parent element border) could be usingbox-shadow
If you want simple and rookie solution , use other over it , add different z-index to both elements and adjust position as per your need .