@@ -154,7 +154,7 @@ The Astro `
```
-2. Add the icon to `Header.astro` so that it will be displayed on all pages. Don't forget to import the component.
+2. Import and add the `` component to `Header.astro` so that it will be displayed on all pages. Wrap both `` and `` inside a `` to group them together for styling, and add the `
```
3. Visit your browser preview at `http://localhost:4321` to see the icon now on all your pages. You can try clicking it, but you have not written a script to make it interactive yet.
@@ -83,12 +92,34 @@ Choose some alternate colors to use in dark mode.
color: #fff;
}
+ .dark .menu {
+ background-color: #fff;
+ color: #000;
+ }
+
+ .dark .nav-links a:hover,
+ .dark .nav-links a:focus {
+ color: #0d0950;
+ }
+
.dark .nav-links a {
color: #fff;
}
+
+ .dark a {
+ color: #ff9776;
+ }
```
+:::tip[Check colors for accessibility]
+When you update your site to include dark mode, some colors used may need updating.
+
+Always check your rendered site when adding new styles and colors, and make adjustments when necessary! This can mean adding more `.dark` CSS style rules to display different styles in dark mode, or you may wish to update some colors so that they work equally well in both themes.
+
+Consider using accessibility tools such as a contrast checker when creating a set of colors for your site. Or, you can run a check on your website with a browser extension to spot any potential issues.
+:::
+
## Add client-side interactivity
To add interactivity to an Astro component, you can use a `