/ src / components / WelcomeItem.vue
WelcomeItem.vue
 1  <template>
 2    <div class="item">
 3      <i>
 4        <slot name="icon"></slot>
 5      </i>
 6      <div class="details">
 7        <h3>
 8          <slot name="heading"></slot>
 9        </h3>
10        <slot></slot>
11      </div>
12    </div>
13  </template>
14  
15  <style scoped>
16  .item {
17    margin-top: 2rem;
18    display: flex;
19    position: relative;
20  }
21  
22  .details {
23    flex: 1;
24    margin-left: 1rem;
25  }
26  
27  i {
28    display: flex;
29    place-items: center;
30    place-content: center;
31    width: 32px;
32    height: 32px;
33    color: var(--color-text);
34  }
35  
36  h3 {
37    font-size: 1.2rem;
38    font-weight: 500;
39    margin-bottom: 0.4rem;
40    color: var(--color-heading);
41  }
42  
43  @media (min-width: 1024px) {
44    .item {
45      margin-top: 0;
46      padding: 0.4rem 0 1rem calc(var(--section-gap) / 2);
47    }
48  
49    i {
50      top: calc(50% - 25px);
51      left: -26px;
52      position: absolute;
53      border: 1px solid var(--color-border);
54      background: var(--color-background);
55      border-radius: 8px;
56      width: 50px;
57      height: 50px;
58    }
59  
60    .item:before {
61      content: ' ';
62      border-left: 1px solid var(--color-border);
63      position: absolute;
64      left: 0;
65      bottom: calc(50% + 25px);
66      height: calc(50% - 25px);
67    }
68  
69    .item:after {
70      content: ' ';
71      border-left: 1px solid var(--color-border);
72      position: absolute;
73      left: 0;
74      top: calc(50% + 25px);
75      height: calc(50% - 25px);
76    }
77  
78    .item:first-of-type:before {
79      display: none;
80    }
81  
82    .item:last-of-type:after {
83      display: none;
84    }
85  }
86  </style>