How to apply custom css to CKEditor?

Custom client-side CSS to change background colours.

  • CSS, greasemonkey, sunglasses? Is there a way to stop white web pages hurting my eyes (firefox, osx). Even on the lowest brightness setting, I find, of an evening, that white-backgrounded web pages are too bright on my macbook. I suspect there's some way for me to have a local CSS file or something that I can turn on and off at will, to just swap white backgrounds for a more muted grey. Or something. Everything I see on google seems to be about blogs, but I want this on the client side. I suppose there could also be a greasemonkey way to do this, but greasemonkey scares me more than CSS. Corey Hart scares me more than both. So, in question form: what is the simplest way to have a switchable setting to darken white backgrounds? (and/or: is there a good client-side CSS tutorial site which could teach me to work this out myself?)

  • Answer:

    try this bookmarklet: javascript:(function(){var newSS, styles='* { background: #1A2424 ! important; color: cyan !important } :link, :link * { color: #66FF99 !important } :visited, :visited * { color: #9966CC !important }'; if( document.createStyleSheet) { document.createStyleSheet(%22javascript:'%22+styles+%22'%22); } else { newSS=document.createElement('link'); newSS.rel='stylesheet'; newSS.href='data:text/css,'+escape(styles); document.getElementsByTagName(%22head%22)[0].appendChild(newSS); } })();

pompomtom at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

http://ask.metafilter.com/81103/Custom-clientside-CSS-to-change-background-colours#1202792 there is hit alt-shift-print screen if what we are thinking of is the same thing

DJWeezy

If you don't want to mess around with css or Greasemonkey you might like to try a program like http://docs.blacktree.com/nocturne/nocturne which simply inverts the colours on your screen making it much nicer to look at under certain conditions.

sveskemus

one approach for this on OS X is Ctrl+Alt+Apple+8. pressing all those keys at once throws the color scheme to the "negative," which will usually switch white backgrounds to black, then with white text. i just wish there were a way to do this on the PC at work. grrr.

garfy3

Another "not exactly helpful" solution is http://www.apple.com/downloads/macosx/system_disk_utilities/rggamma.html. It's for using your Mac whenever night vision is critical. It shifts the screen gamma so everything turns monochrome red-black (or green-black or your-choice-black). I use it when hacking in the dark. As for changing it via javascript: I'm guessing this shouldn't be to hard with a javascript bookmarklet. I don't think you'd need grease monkey at all though it has been many years since I used my Javascript fu for good (or evil).

chairface

This bookmarklet will (sometimes) work. Doesn't work on mefi though. Drag it to your toolbar and click. It should at least get you started.

chairface

What you are looking for, I think, is http://accessibar.mozdev.org/. It does a ton of things like this, primarily for people with low vision who need high contrast stuff. I *think* you can make it so the only stuff that changes is the BG color, but you can mess with all the fonts through a series of pulldown menus. Easy peasy. http://farm3.static.flickr.com/2302/2196458494_8138c266d1_o.jpg changed to a grey background. This will, imo, only do it per-site so if you're looking for something that changed all examples of white to grey, this will not help.

jessamyn

By all means don't do the ALT+SHIFT+PRINTSCREEN thing....completely messed up my MSN Messenger and I couldn't revert it without a restart :P

DMan

The Stylish Firefox add on will let you do this by site, although not to every white backgrounded site.

MadamM

If you don't mind switching browsers, Opera does pretty much exactly what you want. There is an option under the View\Style menu which allows you to force one of a series of predefined CSS style sheets upon any unsuspecting website, including two "High Contrast" modes (black on white and white on black) and an "Accessibility Layout" which displays contents in a pleasing black on green colour combination. I think you can also define your own style sheets, but I haven't played with it that much. If you're not totally tied to Firefox, I would recommend giving Opera a try, in any case - it really is a magnificent browser.

doctorpiorno

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.