Skip to content

Commit f396ff0

Browse files
authored
upgrade Docusaurus to 3.9.1, restyle DocSearch v4 (#4820)
1 parent 5a5ce94 commit f396ff0

File tree

8 files changed

+1208
-753
lines changed

8 files changed

+1208
-753
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@
4040
"pretty-quick": "^4.2.2",
4141
"typescript-eslint": "^8.43.0"
4242
},
43-
"packageManager": "[email protected].2"
43+
"packageManager": "[email protected].3"
4444
}

website/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@
4747
]
4848
},
4949
"dependencies": {
50-
"@docusaurus/core": "3.8.1",
51-
"@docusaurus/faster": "3.8.1",
52-
"@docusaurus/plugin-google-gtag": "3.8.1",
53-
"@docusaurus/plugin-pwa": "3.8.1",
54-
"@docusaurus/preset-classic": "3.8.1",
50+
"@docusaurus/core": "3.9.1",
51+
"@docusaurus/faster": "3.9.1",
52+
"@docusaurus/plugin-google-gtag": "3.9.1",
53+
"@docusaurus/plugin-pwa": "3.9.1",
54+
"@docusaurus/preset-classic": "3.9.1",
5555
"docusaurus-plugin-sass": "^0.2.6",
5656
"react": "^19.1.1",
5757
"react-dom": "^19.1.1",
5858
"react-github-btn": "^1.4.0"
5959
},
6060
"devDependencies": {
61-
"@docusaurus/module-type-aliases": "3.8.1",
62-
"@docusaurus/tsconfig": "3.8.1",
63-
"@docusaurus/types": "3.8.1",
61+
"@docusaurus/module-type-aliases": "3.9.1",
62+
"@docusaurus/tsconfig": "3.9.1",
63+
"@docusaurus/types": "3.9.1",
6464
"@react-native-website/lint-examples": "*",
6565
"@types/google.analytics": "^0.0.46",
6666
"@types/react": "^19.1.13",

website/src/components/Home/Hero/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import React from 'react';
99
import GitHubButton from 'react-github-btn';
10+
import {useColorMode} from '@docusaurus/theme-common';
1011

1112
import Logo from '../Logo';
1213
import GridBackground from './GridBackground';
@@ -16,6 +17,7 @@ import Devices from './Devices';
1617
import styles from './styles.module.css';
1718

1819
function Hero() {
20+
const {colorMode} = useColorMode();
1921
return (
2022
<div className={styles.container}>
2123
<div className={styles.socialLinks}>
@@ -30,6 +32,7 @@ function Hero() {
3032
href="https://github.com/facebook/react-native"
3133
data-icon="octicon-star"
3234
data-size="large"
35+
data-color-scheme={colorMode}
3336
aria-label="Star facebook/react-native on GitHub">
3437
Star
3538
</GitHubButton>

website/src/components/Home/Hero/styles.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
gap: 1rem;
2323
margin-top: 1rem;
2424
margin-right: 1rem;
25+
min-height: 36px;
26+
font-size: 14px;
2527
}
2628

2729
.gridBackground {

website/src/css/customTheme.scss

Lines changed: 188 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,27 @@
2121
--navbar-active-item-background: #61dafb11;
2222
--sidebar-active-item-background: #e6f7ff;
2323
--docs-rating-background: #64d7ff33;
24+
--key-shadow:
25+
inset 0 -2px 0 0 var(--ifm-hr-border-color), inset 0 0 1px 1px #fff,
26+
0 1px 2px 1px rgba(30, 35, 90, 0.3);
2427

2528
--doc-sidebar-width: 266px !important;
2629
--rn-note-background: rgba(255, 229, 100, 0.25);
2730

31+
--docsearch-key-background: none;
32+
--docsearch-searchbox-background: white;
33+
--docsearch-modal-background: white;
34+
--docsearch-subtle-color: var(--ifm-table-border-color);
2835
--docsearch-container-background: rgba(32, 35, 42, 0.6);
29-
--docsearch-key-shadow:
30-
inset 0 -2px 0 0 var(--ifm-hr-border-color), inset 0 0 1px 1px #fff,
31-
0 1px 2px 1px rgba(30, 35, 90, 0.3);
36+
--docsearch-muted-color: #969faf;
37+
--docsearch-key-pressed-shadow: inset 0 2px 5px rgba(120, 122, 165, 0.11);
38+
--docsearch-icon-color: var(--subtle);
39+
--docsearch-secondary-text-color: var(--subtle);
40+
--docsearch-hit-background: none;
41+
--docsearch-hit-highlight-color: var(--home-button-primary);
42+
--docsearch-highlight-color: white;
43+
--docsearch-footer-height: 46px;
44+
--docsearch-soft-primary-color: var(--sidebar-active-item-background);
3245

3346
--ifm-font-family-base:
3447
"Optimistic Display", system-ui, -apple-system, sans-serif;
@@ -129,6 +142,9 @@ html[data-theme="dark"] {
129142

130143
--navbar-background: #20232aee;
131144
--sidebar-active-item-background: #61dafb15;
145+
--key-shadow:
146+
inset 0 -2px 0 0 var(--dark), inset 0 0 1px 1px var(--light),
147+
0 2px 2px 0 rgba(3, 4, 9, 0.3);
132148

133149
--ifm-code-background: rgba(255, 255, 255, 0.06);
134150
--ifm-toc-border-color: var(--dark);
@@ -139,13 +155,13 @@ html[data-theme="dark"] {
139155
--ifm-table-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
140156

141157
--docsearch-searchbox-background: var(--ifm-background-color);
142-
--docsearch-modal-background: var(--deepdark);
143-
--docsearch-footer-background: var(--dark);
144-
--docsearch-key-gradient: var(--deepdark);
145-
--docsearch-key-shadow:
146-
inset 0 -2px 0 0 var(--dark), inset 0 0 1px 1px var(--light),
147-
0 2px 2px 0 rgba(3, 4, 9, 0.3);
158+
--docsearch-modal-background: var(--ifm-background-color);
148159
--docsearch-container-background: rgba(0, 0, 0, 0.6);
160+
--docsearch-muted-color: #7f8497;
161+
--docsearch-subtle-color: #282833;
162+
--docsearch-key-pressed-shadow: inset 0 2px 5px rgba(12, 13, 20, 0.4);
163+
--docsearch-modal-shadow: 0 3px 8px 0 #000309;
164+
--docsearch-hit-highlight-color: var(--ifm-color-primary);
149165

150166
--logo: #58c4dc;
151167
--home-hero-floor-background: #151517;
@@ -329,7 +345,7 @@ hr {
329345
position: relative;
330346
padding: 0.2rem 0.3rem;
331347
background: none;
332-
box-shadow: var(--docsearch-key-shadow);
348+
box-shadow: var(--key-shadow);
333349
display: inline-block;
334350
text-align: center;
335351
min-width: 24px;
@@ -892,38 +908,6 @@ a[class*="tagRegular"] {
892908
transform: rotate(180deg) scale(0.9);
893909
}
894910

895-
.DocSearch-Button {
896-
border-radius: 32px;
897-
border: 1px solid var(--light);
898-
padding: 0 8px 0 12px;
899-
font-family: var(--ifm-font-family-base);
900-
901-
.DocSearch-Search-Icon {
902-
width: 16px;
903-
margin-top: -1px;
904-
color: var(--docsearch-muted-color);
905-
}
906-
907-
.DocSearch-Button-Key--pressed {
908-
box-shadow: var(--docsearch-key-shadow);
909-
transform: none;
910-
}
911-
}
912-
913-
.DocSearch-Button-Placeholder {
914-
font-size: 14px;
915-
}
916-
917-
.DocSearch-Button-Key {
918-
font-size: 12px;
919-
font-weight: 600;
920-
background: none;
921-
}
922-
923-
.DocSearch-Button-Keys {
924-
margin-top: 1px;
925-
}
926-
927911
.dropdown__menu {
928912
min-width: 120px;
929913

@@ -1054,6 +1038,168 @@ So we need to "revert" some CSS vars to not enforce dark mode
10541038
}
10551039
}
10561040

1041+
/* DocSearch */
1042+
1043+
.DocSearch-Container {
1044+
backdrop-filter: none !important;
1045+
}
1046+
1047+
.DocSearch-Button {
1048+
border-radius: 32px;
1049+
border: 1px solid var(--light);
1050+
padding: 0 8px 0 12px;
1051+
font-family: var(--ifm-font-family-base);
1052+
color: var(--subtle);
1053+
box-sizing: border-box;
1054+
1055+
&:hover {
1056+
box-shadow: inset 0 0 0 2px var(--ifm-color-primary);
1057+
1058+
.DocSearch-Search-Icon,
1059+
.DocSearch-Button-Placeholder {
1060+
color: var(--subtle);
1061+
}
1062+
}
1063+
}
1064+
1065+
.navbar {
1066+
.DocSearch-Search-Icon {
1067+
width: 16px;
1068+
margin-top: -1px;
1069+
color: var(--docsearch-muted-color);
1070+
}
1071+
}
1072+
1073+
.DocSearch-Button-Placeholder {
1074+
font-size: 14px;
1075+
}
1076+
1077+
.DocSearch-Button-Keys {
1078+
min-width: 42px;
1079+
margin-right: 4px;
1080+
margin-top: 1px;
1081+
gap: 2px;
1082+
1083+
.DocSearch-Button-Key {
1084+
font-size: 12px;
1085+
font-weight: 600;
1086+
background: color-mix(
1087+
in srgb,
1088+
var(--docsearch-subtle-color) 40%,
1089+
transparent
1090+
);
1091+
color: var(--docsearch-muted-color);
1092+
transform: none;
1093+
margin: 0;
1094+
width: 20px;
1095+
height: 20px;
1096+
}
1097+
}
1098+
1099+
.DocSearch-Commands-Key {
1100+
background: color-mix(
1101+
in srgb,
1102+
var(--docsearch-subtle-color) 40%,
1103+
transparent
1104+
);
1105+
border-radius: var(--ifm-code-border-radius);
1106+
color: var(--docsearch-muted-color);
1107+
}
1108+
1109+
.DocSearch-Modal {
1110+
border-radius: var(--ifm-global-radius);
1111+
border: 1px solid var(--ifm-table-border-color);
1112+
}
1113+
1114+
.DocSearch-Form {
1115+
border-radius: var(--ifm-global-radius) var(--ifm-global-radius) 0 0;
1116+
}
1117+
1118+
.DocSearch-Input {
1119+
padding-block-start: 0;
1120+
}
1121+
1122+
.DocSearch-Actions {
1123+
button:hover {
1124+
color: var(--home-button-primary);
1125+
}
1126+
}
1127+
1128+
.DocSearch-Hit {
1129+
&,
1130+
& a {
1131+
border-radius: var(--ifm-global-radius);
1132+
}
1133+
1134+
mark {
1135+
color: var(--home-button-primary);
1136+
}
1137+
1138+
&[aria-selected="true"] {
1139+
span,
1140+
mark {
1141+
color: white;
1142+
}
1143+
}
1144+
1145+
.DocSearch-Hit-content-wrapper {
1146+
gap: 0;
1147+
}
1148+
}
1149+
1150+
.DocSearch-Form:focus-within .DocSearch-MagnifierLabel svg {
1151+
color: var(--home-button-primary);
1152+
}
1153+
1154+
.DocSearch-Footer {
1155+
font-size: 14px;
1156+
border-radius: 0 0 var(--ifm-global-radius) var(--ifm-global-radius);
1157+
1158+
.DocSearch-Logo a {
1159+
display: flex;
1160+
align-items: center;
1161+
1162+
svg {
1163+
filter: grayscale(1);
1164+
opacity: 0.6;
1165+
}
1166+
}
1167+
}
1168+
1169+
html[data-theme="dark"] {
1170+
.DocSearch-Button:hover {
1171+
.DocSearch-Search-Icon,
1172+
.DocSearch-Button-Placeholder {
1173+
color: var(--ifm-font-color-base);
1174+
}
1175+
}
1176+
1177+
.DocSearch-Button-Key {
1178+
background: color-mix(
1179+
in srgb,
1180+
var(--docsearch-subtle-color) 60%,
1181+
transparent
1182+
);
1183+
}
1184+
1185+
.DocSearch-Commands-Key {
1186+
background: color-mix(
1187+
in srgb,
1188+
var(--docsearch-subtle-color) 50%,
1189+
transparent
1190+
);
1191+
}
1192+
1193+
.DocSearch-Logo a svg {
1194+
filter: grayscale(1) brightness(3);
1195+
}
1196+
1197+
.DocSearch-Form,
1198+
.DocSearch-Footer {
1199+
background: none;
1200+
}
1201+
}
1202+
10571203
/* Sidebar */
10581204

10591205
aside[class^="theme-doc-sidebar-container"] {

website/src/theme/Blog/Components/Author/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
margin-left: 0.3rem;
7777
}
7878

79-
svg[class^="authorSocialLink"] {
79+
a[class^="authorSocialLink"] svg {
8080
fill: var(--subtle) !important;
8181

8282
&:hover,

website/src/theme/Icon/Socials/Bluesky/index.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)