Skip to content

Commit

Permalink
feat: add --rp-c-link
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Apr 30, 2024
1 parent a66a626 commit 8fc2d0d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 62 deletions.
11 changes: 1 addition & 10 deletions packages/theme-default/src/components/Aside/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,7 @@
.aside-active {
&,
&:hover {
color: var(--rp-c-brand-dark);
color: var(--rp-c-link);
background-color: var(--rp-c-brand-tint);
}
}

.dark {
.aside-active {
&,
&:hover {
color: var(--rp-c-brand-light);
}
}
}
9 changes: 1 addition & 8 deletions packages/theme-default/src/components/Nav/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,10 @@
.singleItem:hover {
background-color: var(--rp-c-bg-mute);
cursor: pointer;
color: var(--rp-c-brand-dark);
color: var(--rp-c-link);
border-radius: var(--rp-radius);
}

:global(.dark) {
.activeItem,
.singleItem:hover {
color: var(--rp-c-brand-light);
}
}

.navBarTitle {
flex-shrink: 0;
}
Expand Down
16 changes: 1 addition & 15 deletions packages/theme-default/src/components/Overview/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
h3,
h3 > a {
letter-spacing: -0.01em;
color: var(--rp-c-brand);
color: var(--rp-c-link);
font-size: 18px;
margin-bottom: 1em;
transition: color 0.5s;
Expand All @@ -38,11 +38,6 @@
line-height: 1.3;
}

h3 > a:hover {
transition: color 0.5s;
color: var(--rp-c-brand-dark);
}

h3:before {
display: none;
}
Expand Down Expand Up @@ -81,15 +76,6 @@
}
}

:global(.dark) {
:global(.overview-index) {
h3,
h3 > a {
color: var(--rp-c-brand-light);
}
}
}

.overview-groups a {
display: block;
font-size: 15px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

.menuItemActive {
background-color: var(--rp-c-brand-tint);
color: var(--rp-c-brand);
color: var(--rp-c-link);
font-weight: bolder;
position: relative;
}
Expand All @@ -122,12 +122,6 @@
transition: all 0.2s ease;
}

:global(.dark) {
.menuItemActive {
color: var(--rp-c-brand-light);
}
}

.menuGroupActive {
background-color: var(--rp-c-bg-mute);
}
Expand Down
11 changes: 2 additions & 9 deletions packages/theme-default/src/components/Tabs/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,8 @@
}

.selected {
color: var(--rp-c-brand-dark);
border-color: var(--rp-c-brand-dark);
}

:global(.dark) {
.selected {
color: var(--rp-c-brand-light);
border-color: var(--rp-c-brand-light);
}
color: var(--rp-c-link);
border-color: currentColor;
}

.no-scrollbar::-webkit-scrollbar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
:global(summary a) {
&:not(:global(.header-anchor)) {
font-weight: 500;
color: var(--rp-c-brand-dark);
color: var(--rp-c-link);
transition: color 0.25s;
}

Expand All @@ -47,18 +47,6 @@
}
}

:global(.dark) {
.link,
:global(summary) .link,
:global(summary a) {
&:not(:global(.header-anchor)) {
font-weight: 500;
color: var(--rp-c-brand-light);
transition: color 0.25s;
}
}
}

:global(.header-anchor) {
color: var(--rp-c-brand);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/theme-default/src/styles/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
--rp-radius: 1rem;
--rp-radius-small: 0.5rem;
--rp-radius-large: 1.5rem;

--rp-c-link: var(--rp-c-brand-dark);
}

.dark {
Expand All @@ -65,6 +67,8 @@

/* Will be used in overview page */
--rp-c-text-code: #c9def1;

--rp-c-link: var(--rp-c-brand-light);
}

:root {
Expand Down

0 comments on commit 8fc2d0d

Please sign in to comment.