11<script setup lang="ts">
22import { type Filter , getRules , languages } from ' ./data'
33import { computed , type PropType } from ' vue'
4+ import { } from ' vitepress'
45
56const props = defineProps ({
67 filter: {
@@ -21,16 +22,15 @@ const rules = computed(() => getRules(props.filter))
2122 <div class =" rule-header" >
2223 <a :href =" rule.link" class =" rule-name" >{{ rule.name }}</a >
2324 <div class =" rule-badges" >
24- <span class = " badge type " >{{ rule.type }}</ span >
25- <a :href =" `/catalog/${rule.language}/`" class = " badge language " >
26- {{ languages[rule.language] }}
25+ <Badge type = " info " :text = " rule.type" / >
26+ <a :href =" `/catalog/${rule.language}/`" >
27+ < Badge type = " info " :text = " languages[rule.language]" />
2728 </a >
2829 </div >
2930 </div >
3031 <div class =" rule-details" >
31- <span class =" badge fix" :class =" { 'has-fix': rule.hasFix }" >
32- {{ rule.hasFix ? 'Has Fix' : 'No Fix' }}
33- </span >
32+ <Badge v-if =" rule.hasFix" type =" tip" text =" 🛠️ Has Fix" />
33+ <div v-else />
3434 <!--
3535 <div class="features">
3636 <span v-for="feature in rule.features" :key="feature" class="feature-tag">
@@ -39,80 +39,46 @@ const rules = computed(() => getRules(props.filter))
3939 </div>
4040 -->
4141 <a :href =" rule.playgroundLink" class =" playground-link" target =" _blank" >
42- Try in Playground
43- <span class =" arrow" >→</span >
42+ Try in Playground →
4443 </a >
4544 </div >
4645 </li >
4746 </TransitionGroup >
4847</template >
4948
5049<style scoped>
50+ a {
51+ text-decoration : none ;
52+ }
53+ a :hover {
54+ text-decoration : underline ;
55+ }
5156.rule-list {
5257 list-style : none ;
5358 padding : 0 ;
5459 margin : 0 ;
5560}
5661
5762.rule-item {
58- border : 1px solid #e2e8f0 ;
63+ border : 1px solid var ( --vp-c-divider ) ;
5964 border-radius : 8px ;
6065 padding : 1rem ;
61- transition : all 0.2s ease ;
62- }
63-
64- .rule-item :hover {
65- box-shadow : 0 4px 6px -1px rgba (0 , 0 , 0 , 0.1 );
66- transform : translateY (-2px );
6766}
6867
6968.rule-header {
7069 display : flex ;
7170 justify-content : space-between ;
72- align-items : center ;
73- margin-bottom : 0.75rem ;
71+ margin-bottom : 12px ;
7472}
7573
7674.rule-name {
77- font-size : 1.1rem ;
7875 font-weight : 600 ;
79- text-decoration : none ;
80- }
81-
82- .rule-name :hover {
83- text-decoration : underline ;
8476}
8577
8678.rule-badges {
8779 display : flex ;
88- gap : 0.5rem ;
89- }
90-
91- .badge {
92- padding : 0.25rem 0.5rem ;
93- border-radius : 4px ;
94- font-size : 0.875rem ;
95- }
96-
97- .badge.language {
98- background-color : #f3f4f6 ;
99- color : #4b5563 ;
100- text-decoration : none ;
101- }
102-
103- .badge.type {
104- background-color : #e0f2fe ;
105- color : #0369a1 ;
106- }
107-
108- .badge.fix {
109- background-color : #fee2e2 ;
110- color : #991b1b ;
111- }
112-
113- .badge.fix.has-fix {
114- background-color : #dcfce7 ;
115- color : #166534 ;
80+ align-items : center ;
81+ gap : 0.2em ;
11682}
11783
11884.rule-details {
@@ -121,40 +87,10 @@ const rules = computed(() => getRules(props.filter))
12187 align-items : center ;
12288}
12389
124- .features {
125- display : flex ;
126- gap : 0.5rem ;
127- flex-wrap : wrap ;
128- }
129-
130- .feature-tag {
131- background-color : #f3f4f6 ;
132- color : #4b5563 ;
133- padding : 0.25rem 0.5rem ;
134- border-radius : 4px ;
135- font-size : 0.75rem ;
136- }
137-
13890.playground-link {
139- display : inline-flex ;
140- align-items : center ;
141- gap : 0.25rem ;
142- text-decoration : none ;
143- font-size : 0.875rem ;
91+ font-size : 0.8em ;
14492}
14593
146- .playground-link :hover {
147- text-decoration : underline ;
148- }
149-
150- .arrow {
151- font-size : 1.1em ;
152- transition : transform 0.2s ease ;
153- }
154-
155- .playground-link :hover .arrow {
156- transform : translateX (2px );
157- }
15894.v-move ,
15995.v-enter-active ,
16096.v-leave-active {
0 commit comments