====== How to add a simple stylesheet to your DokuWiki ======
A simple way to customize certain styles in DokuWiki without adding plugins or modifying core code is by adding your own CSS file. Luckily, DokuWiki looks for and recognizes a user style file named **userstyle.css**.
So, what follows are some style examples I have implemented in this Wiki.
===== Global CSS Changes (Entire DokuWiki Site) =====
This custom CSS change will persist even after core updates. It is also something you can delete or modify at any time. However, ensure you keep a local copy in case you need it later.
==== Changing the font size ====
- **Create a user stylesheet:** Navigate to your DokuWiki installation directory and find the **//conf/ folder//**. If a file named **userstyle.css** does not yet exist, use your code editor to create a new one. Then upload it when you finish step 2.
- **Add CSS Code:** Insert the following code to increase the base font size for the whole wiki. You can adjust the percentage as needed (e.g., 110% 120%). I'm currently using 120% in this wiki.
body {
font-size: 120% !important;
}
- **Clear Caches (if needed):** After saving the new file, you may need to purge your DokuWiki cache and clear your browser's temporary files to see the changes. See **how** here: [[notes:how_to_clear_cache|How to clear the cache memory after code changes]].
For other style changes I've implemented so far,
see the following subpage: [[notes:Current userstyle.css content sample|Current userstyle.css sample]].
Back to
*[[notes:start|Notes List]]
*[[:start | Home Page]]