Skip to content

Commit a791a6c

Browse files
committed
feat(theme): implement RADFish configuration hook and update theme styles
1 parent f32d840 commit a791a6c

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

templates/react-javascript/src/App.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ import {
99
PrimaryNav,
1010
Header,
1111
} from "@trussworks/react-uswds";
12+
import { useRadFishConfig } from "./hooks/useRadFishConfig.jsx";
1213

1314
import HomePage from "./pages/Home";
1415

1516
function App({ application }) {
1617
const [isExpanded, setExpanded] = useState(false);
18+
const config = useRadFishConfig();
19+
1720
return (
1821
<Application application={application}>
1922
<a className="usa-skipnav" href="#main-content">
@@ -28,7 +31,7 @@ function App({ application }) {
2831
>
2932
<div className="usa-nav-container">
3033
<div className="usa-navbar">
31-
<Title className="header-title">RADFish Application</Title>
34+
<Title className="header-title">{config.app.name}</Title>
3235
<NavMenuButton
3336
onClick={() => setExpanded((prvExpanded) => !prvExpanded)}
3437
label="Menu"

templates/react-javascript/src/hooks/useRadFishConfig.js renamed to templates/react-javascript/src/hooks/useRadFishConfig.jsx

File renamed without changes.

templates/react-javascript/src/styles/theme.css

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,47 @@
1+
/*
2+
* RADFish Theme Styles
3+
*
4+
* These are default/fallback values. To customize your theme,
5+
* edit radfish.config.js in the project root instead of this file.
6+
*
7+
* The Vite plugin will override these variables based on your config.
8+
*/
9+
110
:root {
11+
/* Primary colors - customize via radfish.config.js colors.primary/secondary */
212
--noaa-dark-blue: #0054a4;
313
--noaa-light-blue: #0093d0;
14+
--noaa-accent-color: #00467f;
15+
16+
/* Warning/alert colors - customize via radfish.config.js colors.warningLight/Medium/Dark */
417
--noaa-yellow-one: #fff3cd;
518
--noaa-yellow-two: #ffeeba;
619
--noaa-yellow-three: #856404;
7-
--noaa-accent-color: #00467f;
20+
21+
/* UI colors - customize via radfish.config.js colors section */
822
--noaa-text-color: #333;
923
--noaa-error-color: #af292e;
1024
--noaa-button-hover: #0073b6;
1125
--noaa-label-color: #0054a4;
1226
--noaa-border-dark: #565c65;
1327
--noaa-border-light: #ddd;
28+
29+
/* RADFish-specific variables (mapped from config) */
30+
--radfish-background: #f4f4f4;
31+
--radfish-header-bg: var(--noaa-dark-blue);
32+
--radfish-font-family: Arial Narrow, sans-serif;
1433
}
1534

1635
body {
17-
font-family:
18-
Arial Narrow,
19-
sans-serif;
36+
font-family: var(--radfish-font-family);
2037
color: var(--noaa-text-color);
21-
background-color: #f4f4f4;
38+
background-color: var(--radfish-background);
2239
line-height: 1.6;
2340
border-radius: 4px;
2441
}
2542

2643
.header-container {
27-
background: var(--noaa-dark-blue);
44+
background: var(--radfish-header-bg);
2845
}
2946

3047
.header-title {

0 commit comments

Comments
 (0)