Using the Stylish chrome extension to override this font
Categories:
Overriding Website Fonts with Stylish Chrome Extension

Learn how to use the Stylish Chrome extension to customize website fonts, enhancing readability and personalizing your browsing experience. This guide covers installation, CSS basics, and practical application.
Have you ever visited a website and wished you could change its default font to something more aesthetically pleasing or easier to read? The Stylish Chrome extension provides a powerful way to inject custom CSS into any website, allowing you to override styles, including fonts. This article will guide you through the process of installing Stylish, identifying the font elements, and writing the CSS to achieve your desired font changes.
Understanding How Stylish Works
Stylish is a user style manager that allows you to apply custom themes and skins to websites. It works by injecting your custom CSS rules directly into the webpage after the original styles have loaded. This means your rules can override existing styles, provided they have sufficient specificity. For font changes, you'll typically target common elements like body
, p
, h1
, h2
, etc., or more specific classes/IDs if you want to change only certain parts of a page.
flowchart TD A[User Browses Website] --> B{Website Loads Original CSS} B --> C[Stylish Detects Matching Style] C --> D{Stylish Injects Custom CSS} D --> E[Browser Renders Page with Custom Styles] E --> F[User Sees Modified Font]
Flowchart illustrating how Stylish injects custom CSS to override website styles.
Installation and Basic Usage
First, you need to install the Stylish extension from the Chrome Web Store. Once installed, a small 'S' icon will appear in your browser's toolbar. Clicking this icon will open a panel where you can manage your installed styles or create new ones for the current site.
1. Install Stylish
Navigate to the Chrome Web Store and search for 'Stylish - Custom themes for any website'. Click 'Add to Chrome' and confirm the installation.
2. Open Stylish Editor
Go to the website where you want to change the font. Click the Stylish icon in your toolbar, then select 'Write new style' or 'Manage installed styles' if you want to edit an existing one.
3. Identify Elements
Right-click on the text you want to change and select 'Inspect' (or 'Inspect Element'). This will open Chrome's Developer Tools. In the 'Elements' tab, you can see the HTML structure and the CSS rules applied to the selected element. Pay attention to the font-family
property and the selectors used.
Writing Custom CSS for Font Overrides
The core of overriding fonts lies in writing effective CSS. You'll use the font-family
property to specify your desired font. It's good practice to include fallback fonts in case your primary font isn't available on the user's system. You can also use @import
rules to bring in web fonts from services like Google Fonts.
/* Example 1: Changing the body font */
body {
font-family: "Open Sans", Arial, sans-serif !important;
}
/* Example 2: Changing heading fonts */
h1, h2, h3 {
font-family: "Roboto Slab", serif !important;
}
/* Example 3: Importing a Google Font and applying it */
@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap');
p {
font-family: 'Montserrat', sans-serif !important;
}
CSS examples for overriding font families on different HTML elements.
!important
when overriding styles with Stylish. This ensures your custom rules take precedence over the website's default styles, even if they have higher specificity.Applying and Managing Your Styles
Once you've written your CSS in the Stylish editor, give your style a descriptive name and click 'Save'. The changes should apply immediately to the current website. You can enable or disable styles from the Stylish toolbar menu, or edit them further if needed. Remember that these changes are local to your browser and won't affect how others view the website.