Skip to content

Commit a286c36

Browse files
committed
refactor: use tailwind to create utility colors by CSS variables
1 parent 9a141d0 commit a286c36

20 files changed

+101
-150
lines changed

src/.vuepress/theme/components/CardPost.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default {
8888
<style lang="scss">
8989
.card-post {
9090
&:hover, &:focus-within {
91-
@apply border-accent;
91+
@apply border-accent-primary;
9292
9393
.card-post-title > a {
9494
text-decoration-color: var(--color);

src/.vuepress/theme/components/HeaderFullPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
}
3939
4040
> div:first-child {
41-
background: var(--bg-secondary);
41+
@apply bg-primary;
4242
background: radial-gradient(circle at center, var(--accent) 10%, transparent 12%), transparent;
4343
background-size: 40px 40px;
4444
}

src/.vuepress/theme/components/NewsletterForm.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
type="email"
2121
required
2222
autocomplete="email"
23-
class="w-full p-4 border border-solid rounded-md outline-none newsletter-form-input c-border-color hover:border-accent focus:border-accent"
23+
class="w-full p-4 border border-solid rounded-md outline-none bg-main newsletter-form-input c-border-color hover:border-accent-primary focus:border-accent-primary"
2424
:placeholder="$themeLocaleConfig.a11y.newsletter.placeholder"
2525
>
2626
</label>
@@ -87,7 +87,6 @@ export default {
8787
.newsletter-form {
8888
&-input {
8989
border-bottom-width: 6px;
90-
background-color: var(--bg-input-news);
9190
}
9291
9392
&-btn {

src/.vuepress/theme/components/PageEdit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
v-if="$themeConfig.editLinks"
88
:href="editLink"
99
:label="$themeLocaleConfig.editLinkText"
10-
class="mb-4 border-b-2 border-accent"
10+
class="mb-4 border-b-2 border-accent-primary"
1111
/>
1212
<div
1313
v-if="$themeConfig.lastUpdated"

src/.vuepress/theme/components/SettingOption.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default {
7575
}
7676
7777
&:focus-within {
78-
outline: 2px solid var(--border-outline);
78+
outline: 2px solid var(--color);
7979
outline-offset: 3px;
8080
}
8181

src/.vuepress/theme/components/TheFooter.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<footer class="relative z-10 footer">
3-
<div class="flex justify-center w-full px-4 py-24 border border-solid lg:py-32 c-bg-secondary c-border-color">
3+
<div class="flex justify-center w-full px-4 py-24 border border-solid lg:py-32 bg-primary c-border-color">
44
<div class="max-w-md">
55
<div class="flex justify-center">
66
<vp-icon
@@ -26,7 +26,7 @@
2626
>
2727
<a
2828
:href="social.link"
29-
class="block p-5 border border-solid rounded-full c-border-color btn-social"
29+
class="block p-5 border border-solid rounded-full c-border-color bg-main hover:border-accent-primary"
3030
target="_blank"
3131
rel="me noopener"
3232
>
@@ -58,9 +58,3 @@ export default {
5858
}
5959
}
6060
</script>
61-
62-
<style lang="scss">
63-
.btn-social {
64-
background-color: var(--bg);
65-
}
66-
</style>

src/.vuepress/theme/components/TheHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default {
129129
130130
&-logo--bg {
131131
@media (min-width: theme('screens.lg')) {
132-
background-image: var(--bg-left);
132+
@apply bg-page-gradient-left;
133133
}
134134
}
135135

src/.vuepress/theme/components/TheNavigation.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<a
1717
:href="href"
1818
:aria-current="isActive && $route.path.indexOf(item.link) === 0 ? 'page' : null"
19-
class="px-3 py-3 border-b-4 border-transparent border-solid the-nav-link hover:border-accent"
20-
:class="{ 'active border-accent': isActive && $route.path.indexOf(item.link) === 0 }"
19+
class="px-3 py-3 border-b-4 border-transparent border-solid the-nav-link hover:border-accent-primary"
20+
:class="{ 'active border-accent-primary': isActive && $route.path.indexOf(item.link) === 0 }"
2121
@click="navigate"
2222
>
2323
{{ item.text }}
@@ -26,7 +26,7 @@
2626
</li>
2727
<li>
2828
<ExternalLink
29-
class="px-3 py-3 border-b-4 border-transparent border-solid the-nav-link hover:border-accent"
29+
class="px-3 py-3 border-b-4 border-transparent border-solid the-nav-link hover:border-accent-primary"
3030
:href="`https://github.com/${$themeConfig.repo}`"
3131
label="Github"
3232
/>

src/.vuepress/theme/components/TheSidebar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ export default {
109109
margin-top: 1px;
110110
> a:focus, > a:hover, > a.active {
111111
position: relative;
112-
background-color: var(--bg-hover-sidebar);
112+
background-color: var(--secondary);
113113
114114
&:before {
115-
@apply absolute top-0 right-0 h-full bg-accent;
115+
@apply absolute top-0 right-0 h-full bg-accent-primary;
116116
content: '';
117117
width: 6px;
118118
}

src/.vuepress/theme/components/WebMentions.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
aria-label="Webmention"
77
>
88
<h2 class="text-2xl font-bold">
9-
({{ webmentions.length }}) Webmentions<span class="text-accent">.</span>
9+
({{ webmentions.length }}) Webmentions<span class="text-accent-primary">.</span>
1010
</h2>
1111

1212
<div class="my-12 webmentions-interact">
@@ -20,7 +20,7 @@
2020
>
2121
<vp-icon
2222
name="like"
23-
class="mr-1 text-accent"
23+
class="mr-1 text-accent-primary"
2424
/>
2525
<span class="ml-2 uppercase">Likes</span>
2626
</div>
@@ -64,7 +64,7 @@
6464
>
6565
<vp-icon
6666
name="share"
67-
class="mr-1 text-accent"
67+
class="mr-1 text-accent-primary"
6868
/>
6969
<span class="ml-2 uppercase">Reposts</span>
7070
</div>
@@ -104,7 +104,7 @@
104104

105105
<div class="mt-24 webmentions-comments">
106106
<h3 class="mb-12 text-xl">
107-
<span class="text-2xl font-bold">Comments <span class="text-accent">.</span></span>
107+
<span class="text-2xl font-bold">Comments <span class="text-accent-primary">.</span></span>
108108
</h3>
109109
<ul
110110
v-if="mentions.length"
@@ -281,7 +281,7 @@ export default {
281281
}
282282
283283
a {
284-
@apply text-accent;
284+
@apply text-accent-primary;
285285
}
286286
}
287287
}

0 commit comments

Comments
 (0)