Skip to content

Commit dc78c56

Browse files
authored
refactor: improve color usage consistency (#8042)
1 parent bd3d39e commit dc78c56

12 files changed

Lines changed: 37 additions & 27 deletions

File tree

src/components/Badge/Badge.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
@use "../../styles/partials/functions" as *;
2+
13
.badge {
24
background-color: #1d78c1;
35
padding: 0 4px;
4-
color: #fff;
6+
color: getColor(white);
57
position: relative;
68
top: -4px;
79
font-size: 14px;

src/components/CodeBlockWithCopy/CodeBlockWithCopy.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../../styles/partials/functions" as *;
2+
13
.code-block-wrapper {
24
position: relative;
35
margin-bottom: 1.5rem;
@@ -25,7 +27,7 @@
2527
/* visible on hover */
2628
opacity: 0;
2729

28-
background-color: #175d96;
30+
background-color: getColor(denim);
2931
color: #e2e8f0;
3032

3133
transition:

src/components/Dropdown/Dropdown.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
button {
77
cursor: pointer;
8-
color: #fff;
8+
color: getColor(white);
99
border: none;
1010
background-color: transparent;
1111
margin: 0;
@@ -48,13 +48,13 @@
4848
ul li {
4949
padding: 0.25em 0.5em;
5050
list-style: none;
51-
color: #fff;
51+
color: getColor(white);
5252
transition: all 250ms;
5353

5454
a:link,
5555
a:visited,
5656
a:hover {
57-
color: #fff;
57+
color: getColor(white);
5858
}
5959

6060
&:hover {

src/components/Markdown/Markdown.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ $topHeightMobileWithBanner: $bannerHeight + $topHeightMobile;
215215
}
216216

217217
&.preview {
218-
background-color: #f2f2f2;
218+
background-color: getColor(concrete);
219219
color: #716b53;
220220
border-left-color: #1e72b3;
221221
}
@@ -308,7 +308,7 @@ $topHeightMobileWithBanner: $bannerHeight + $topHeightMobile;
308308
border-right: none;
309309
display: grid;
310310
grid-template-columns: repeat(2, minmax(0, 1fr));
311-
border-bottom: 1px solid #f2f2f2;
311+
border-bottom: 1px solid getColor(concrete);
312312
text-align: left;
313313
&::before {
314314
content: attr(data-th);

src/components/OfflineBanner/OfflineBanner.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
@use "../../styles/partials/functions" as *;
2+
13
.offline-banner {
24
display: flex;
35
align-items: center;
46
justify-content: center;
57
padding: 8px 20px;
6-
background-color: #2b3a42;
7-
color: #fff;
8+
background-color: getColor(elephant);
9+
color: getColor(white);
810
font-size: 14px;
911
font-weight: 500;
1012
text-align: center;
11-
border-bottom: 1px solid #465e69;
13+
border-bottom: 1px solid getColor(fiord);
1214

1315
&__content {
1416
display: flex;
@@ -20,7 +22,7 @@
2022
flex-shrink: 0;
2123
width: 16px;
2224
height: 16px;
23-
fill: #8dd6f9;
25+
fill: getColor(malibu);
2426
}
2527

2628
&__text {

src/components/Page/Page.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
line-height: 1.2;
3434

3535
a {
36-
color: #2b3a42;
36+
color: getColor(elephant);
3737
text-decoration: none;
3838

3939
&:hover {
@@ -43,7 +43,7 @@
4343
}
4444

4545
.blog-post-date {
46-
color: #666;
46+
color: getColor(dove-grey);
4747
font-size: 1.2rem;
4848
font-weight: 600;
4949
margin-top: 0.25rem;
@@ -52,7 +52,7 @@
5252
}
5353

5454
p {
55-
color: #535353;
55+
color: getColor(emperor);
5656
line-height: 1.4;
5757
margin-bottom: 1rem;
5858
}
@@ -78,7 +78,7 @@
7878
color: getColor(dusty-blue) !important;
7979

8080
&:hover {
81-
color: #8dd6f9 !important;
81+
color: getColor(malibu) !important;
8282
}
8383
}
8484

@@ -87,11 +87,11 @@
8787
}
8888

8989
p {
90-
color: #dedede;
90+
color: getColor(alto);
9191
}
9292

9393
.read-more {
94-
color: #8dd6f9;
94+
color: getColor(malibu);
9595
}
9696
}
9797
}

src/components/ScrollToTop/ScrollToTop.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../../styles/partials/functions" as *;
2+
13
// Scroll to Top Button Styles
24
.scroll-to-top {
35
position: fixed;
@@ -19,8 +21,8 @@
1921
width: 3rem;
2022
height: 3rem;
2123
border-radius: 50%;
22-
background-color: #2b3a42;
23-
color: #fff;
24+
background-color: getColor(elephant);
25+
color: getColor(white);
2426
border: 5px solid #1c78c0;
2527
cursor: pointer;
2628
transition: all 0.3s ease-in-out;
@@ -33,7 +35,7 @@
3335
transform: translateY(-2px);
3436

3537
.scroll-to-top__icon {
36-
color: #ffffff;
38+
color: getColor(white);
3739
}
3840
}
3941

@@ -44,7 +46,7 @@
4446
// Dark mode support
4547
@media (prefers-color-scheme: dark) {
4648
background-color: #f5f5f5;
47-
color: #2b3a42;
49+
color: getColor(elephant);
4850
border-color: #1c78c0;
4951

5052
&:hover {

src/components/Sidebar/Sidebar.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
}
4949

5050
.sidebar__docs-version {
51-
color: #535353;
52-
border-top: 1px solid #f2f2f2;
51+
color: getColor(emperor);
52+
border-top: 1px solid getColor(concrete);
5353
margin-top: 12px;
5454
padding-top: 12px;
5555
font-size: 15px;

src/components/SidebarItem/SidebarItem.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
@include control-overflow;
2929
&.active {
3030
font-weight: 600;
31-
color: #333;
31+
color: getColor(mine-shaft);
3232
}
3333
}
3434

src/components/Site/Site.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
@use "../../styles/partials/functions" as *;
2+
13
.site {
24
display: flex;
35
flex-direction: column;
46
min-height: 100vh;
5-
background: #ffffff;
7+
background: getColor(white);
68

79
&__header {
810
z-index: 100;

0 commit comments

Comments
 (0)