Skip to content

Commit 050e304

Browse files
committed
Change from scoped styles to module and rename classes to camelCase
1 parent 928357e commit 050e304

21 files changed

Lines changed: 242 additions & 223 deletions

components/Contact.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ function copyEmailToClipboard() {
1111
<template>
1212
<section
1313
id="contact"
14-
class="contact"
14+
:class="$style.contact"
1515
>
16-
<h2 class="title">
16+
<h2 :class="$style.title">
1717
{{ $t('contact.title') }}
1818
</h2>
1919

2020
<div
2121
v-cursor-hover
22-
class="content"
22+
:class="$style.content"
2323
@click="copyEmailToClipboard();"
2424
>
2525
<Icon
2626
name="clarity:email-solid"
2727
size="35"
2828
/>
2929

30-
<span class="email">iwaniukmaciej1@gmail.com</span>
30+
<span :class="$style.email">iwaniukmaciej1@gmail.com</span>
3131
</div>
3232
</section>
3333
</template>
3434

35-
<style lang="less" scoped>
35+
<style module lang="less">
3636
@import '@/styles/variables.less';
3737
3838
.contact {

components/Cursor.vue

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ const cursorStore = useCursorStore();
1515
<div
1616
v-show="cursorStore.visibility === CursorVisible"
1717
aria-hidden="true"
18-
class="cursor"
19-
:class="{ 'cursor-dark-theme': themeStore.isDark,
20-
'cursor-light-theme': themeStore.isLight,
21-
'hover': cursorStore.hover }"
18+
:class="[
19+
$style.cursor,
20+
{ [$style.cursorDarkTheme]: themeStore.isDark,
21+
[$style.cursorLightTheme]: themeStore.isLight,
22+
[$style.hover]: cursorStore.hover }
23+
]"
2224
/>
2325

2426
<button
2527
v-cursor-hover
26-
class="toggle-visibility-of-cursor-button"
28+
:class="$style.toggleVisibilityOfCursorButton"
2729
aria-label="Cursor switch"
2830
@click="cursorStore.toggleVisibility();"
2931
>
@@ -34,7 +36,7 @@ const cursorStore = useCursorStore();
3436
</button>
3537
</template>
3638

37-
<style lang="less" scoped>
39+
<style module lang="less">
3840
@import '@/styles/variables.less';
3941
4042
.cursor {
@@ -58,7 +60,7 @@ const cursorStore = useCursorStore();
5860
transform: scale(2);
5961
}
6062
61-
.toggle-visibility-of-cursor-button {
63+
.toggleVisibilityOfCursorButton {
6264
display: none;
6365
position: fixed;
6466
bottom: 0.6rem;
@@ -75,16 +77,16 @@ const cursorStore = useCursorStore();
7577
.cursor {
7678
display: block;
7779
}
78-
.toggle-visibility-of-cursor-button {
80+
.toggleVisibilityOfCursorButton {
7981
display: block;
8082
}
8183
}
8284
83-
.cursor-dark-theme {
85+
.cursorDarkTheme {
8486
border-color: #dark[cursor-color];
8587
}
8688
87-
.cursor-light-theme {
89+
.cursorLightTheme {
8890
border-color: #light[cursor-color];
8991
}
9092
</style>

components/Education/Education.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ const educationItems: Education[] = [
4848
<template>
4949
<section
5050
id="education"
51-
class="education"
51+
:class="$style.education"
5252
>
53-
<h2 class="title">
53+
<h2 :class="$style.title">
5454
{{ $t('education.title') }}
5555
</h2>
5656

57-
<div class="items">
57+
<div :class="$style.items">
5858
<EducationItem
5959
v-for="(education, index) in educationItems"
6060
:key="index"
@@ -69,7 +69,7 @@ const educationItems: Education[] = [
6969
</section>
7070
</template>
7171

72-
<style lang="less" scoped>
72+
<style module lang="less">
7373
@import '@/styles/variables.less';
7474
7575
.education {

components/Education/EducationItem.vue

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,32 @@ const themeStore = useThemeStore();
2222
<div>
2323
<a
2424
v-cursor-hover
25-
class="link"
25+
:class="$style.link"
2626
target="_blank"
2727
:href="props.url"
2828
>
2929
<div
30-
class="education-item"
31-
:class="{ 'education-item-dark-theme': themeStore.isDark,
32-
'education-item-light-theme': themeStore.isLight }"
30+
:class="[
31+
$style.educationItem,
32+
{ [$style.educationItemDarkTheme]: themeStore.isDark,
33+
[$style.educationItemLightTheme]: themeStore.isLight }
34+
]"
3335
>
34-
<h3 class="title">{{ props.title }}</h3>
36+
<h3 :class="$style.title">{{ props.title }}</h3>
3537

36-
<p class="content">
38+
<p :class="$style.content">
3739
{{ props.content }}
3840
</p>
3941

40-
<div class="technologies">
42+
<div :class="$style.technologies">
4143
<TechnologyElement
4244
v-for="(technology, index) in props.technologies"
4345
:key="index"
4446
:element="technology"
4547
/>
4648
</div>
4749

48-
<p class="below">
50+
<p :class="$style.below">
4951
<span>{{ props.major }}</span>
5052
<span>{{ props.period }}</span>
5153
</p>
@@ -54,14 +56,14 @@ const themeStore = useThemeStore();
5456
</div>
5557
</template>
5658

57-
<style lang="less" scoped>
59+
<style module lang="less">
5860
@import '@/styles/variables.less';
5961
6062
.link {
6163
text-decoration: none;
6264
color: inherit;
6365
}
64-
.education-item {
66+
.educationItem {
6567
display: flex;
6668
flex-direction: column;
6769
text-align: center;
@@ -109,7 +111,7 @@ const themeStore = useThemeStore();
109111
}
110112
111113
@media (min-width: @first-breakpoint) {
112-
.education-item {
114+
.educationItem {
113115
.title {
114116
max-width: 25rem;
115117
}
@@ -123,11 +125,11 @@ const themeStore = useThemeStore();
123125
124126
}
125127
126-
.education-item-dark-theme {
128+
.educationItemDarkTheme {
127129
background-color: #dark[background-color-on-element];
128130
}
129131
130-
.education-item-light-theme {
132+
.educationItemLightTheme {
131133
background-color: #light[background-color-on-element];
132134
}
133135
</style>

components/Experience/Experience.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ function getTranslatedPeriod(startDate: Date, endDate: Date | null): string {
151151
<template>
152152
<section
153153
id="experience"
154-
class="experience"
154+
:class="$style.experience"
155155
>
156-
<h2 class="title">
156+
<h2 :class="$style.title">
157157
{{ $t('experience.title') }}
158158
</h2>
159159

160-
<div class="items">
160+
<div :class="$style.items">
161161
<ExperienceItem
162162
v-for="(experience, index) in experienceItems"
163163
:key="index"
@@ -174,7 +174,7 @@ function getTranslatedPeriod(startDate: Date, endDate: Date | null): string {
174174
</section>
175175
</template>
176176

177-
<style lang="less" scoped>
177+
<style module lang="less">
178178
@import '@/styles/variables.less';
179179
180180
.experience {

components/Experience/ExperienceItem.vue

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,71 +22,73 @@ const themeStore = useThemeStore();
2222
</script>
2323

2424
<template>
25-
<div class="experience-item-container">
25+
<div :class="$style.experienceItemContainer">
2626
<div
2727
v-if="index % 2 === 1"
28-
class="visible-on-big-screen"
28+
:class="$style.visibleOnBigScreen"
2929
/>
3030
<ExperienceTimeline
3131
v-if="index % 2 === 1"
32-
class="visible-on-big-screen"
32+
:class="$style.visibleOnBigScreen"
3333
/>
3434
<a
3535
v-cursor-hover
36-
class="link"
36+
:class="$style.link"
3737
target="_blank"
3838
:href="props.url"
3939
>
4040
<div
41-
class="experience-item"
42-
:class="{ 'experience-item-dark-theme': themeStore.isDark,
43-
'experience-item-light-theme': themeStore.isLight }"
41+
:class="[
42+
$style.experienceItem,
43+
{ [$style.experienceItemDarkTheme]: themeStore.isDark,
44+
[$style.experienceItemLightTheme]: themeStore.isLight }
45+
]"
4446
>
45-
<h3 class="companyName">{{ props.companyName }}</h3>
47+
<h3 :class="$style.companyName">{{ props.companyName }}</h3>
4648

47-
<p class="content">
49+
<p :class="$style.content">
4850
{{ props.content }}
4951
</p>
5052

51-
<div class="technologies">
53+
<div :class="$style.technologies">
5254
<TechnologyElement
5355
v-for="(technology, indexKey) in props.technologies"
5456
:key="indexKey"
5557
:element="technology"
5658
/>
5759
</div>
5860

59-
<p class="below">
61+
<p :class="$style.below">
6062
<span>{{ props.profession }}</span>
61-
<span class="job-time">
62-
<span class="date-range">{{ dateRange }}</span>
63+
<span :class="$style.jobTime">
64+
<span :class="$style.dateRange">{{ dateRange }}</span>
6365
<span>{{ period }}</span>
6466
</span>
6567
</p>
6668
</div>
6769
</a>
6870
<ExperienceTimeline
6971
v-if="index % 2 === 0"
70-
class="visible-on-big-screen"
72+
:class="$style.visibleOnBigScreen"
7173
/>
7274
<div
7375
v-if="index % 2 === 0"
74-
class="visible-on-big-screen"
76+
:class="$style.visibleOnBigScreen"
7577
/>
7678
</div>
7779
</template>
7880

79-
<style lang="less" scoped>
81+
<style module lang="less">
8082
@import '@/styles/variables.less';
8183
82-
.visible-on-big-screen {
84+
.visibleOnBigScreen {
8385
display: none;
8486
}
8587
.link {
8688
text-decoration: none;
8789
color: inherit;
8890
}
89-
.experience-item {
91+
.experienceItem {
9092
display: flex;
9193
flex-direction: column;
9294
text-align: center;
@@ -143,7 +145,7 @@ const themeStore = useThemeStore();
143145
}
144146
145147
@media (min-width: @first-breakpoint) {
146-
.experience-item {
148+
.experienceItem {
147149
.companyName {
148150
max-width: 25rem;
149151
}
@@ -163,21 +165,21 @@ const themeStore = useThemeStore();
163165
}
164166
165167
@media (min-width: @second-breakpoint) {
166-
.experience-item-container {
168+
.experienceItemContainer {
167169
display: grid;
168170
grid-template-columns: 4fr 1fr 4fr;
169171
170-
.visible-on-big-screen {
172+
.visibleOnBigScreen {
171173
display: block;
172174
}
173175
}
174176
}
175177
176-
.experience-item-dark-theme {
178+
.experienceItemDarkTheme {
177179
background-color: #dark[background-color-on-element];
178180
}
179181
180-
.experience-item-light-theme {
182+
.experienceItemLightTheme {
181183
background-color: #light[background-color-on-element];
182184
}
183185
</style>

0 commit comments

Comments
 (0)