Skip to content

Instantly share code, notes, and snippets.

@colinangusmackay
Last active November 3, 2025 19:49
Show Gist options
  • Select an option

  • Save colinangusmackay/5273896 to your computer and use it in GitHub Desktop.

Select an option

Save colinangusmackay/5273896 to your computer and use it in GitHub Desktop.
Custom CSS file for Chrome
/*
This is a custom css file for Chrome. It can be used to create an
initial stylesheet for a document.
It should be placed in the following location:
Windows: C:\Users\<user>\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets
Mac: Mac: ~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css
Linux (Chromium): ~/.config/chromium/Default/User StyleSheets/Custom.css
License:
Copyright (C) 2013 Colin Angus Mackay
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
body
{
background-color: #ffe;
font-family: Bookman Old Style;
text-height: 1.2em;
padding: 1em;
margin: 1em;
}
h1
{
font-weight: bold;
text-height: 2em;
}
h2
{
font-weight: bold;
text-height: 1.6em;
}
h3
{
font-weight: bold;
text-height: 1.4em;
}
pre
{
font-family: Consolas;
border: 1px solid #cc7;
background-color: #ffa;
padding: 0.4em;
margin: 0.4em;
-webkit-box-shadow: 0.2em 0.2em 0.3em 0 #cc9;
}
code
{
font-family: Consolas;
font-weight: bold;
}
blockquote
{
border: 1px solid #ddd;
background-color: #fff;
padding: 0.4em;
-webkit-box-shadow: 0.2em 0.2em 0.3em 0 #ddd;
}
@adammontague
Copy link

I assume this works in the same way as Safari does with its Advanced Settings stylesheet? Or have I misunderstood? So far I'm not seeing any difference on sites in Chrome.

@colinangusmackay
Copy link
Author

I'm sorry, this was posted 12 years ago and it looks like this feature is largely deprecated in modern Chrome. The User StyleSheets directory method hasn't worked reliably in Chrome for many years. There are browser extensions that do similar things, but I don't use them, so can't really recommend any.

@adammontague
Copy link

Aaaah! I should'e done a bit of due diligence before commenting! I've now found this to be the case, how frustrating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment