Code Monkey home page Code Monkey logo

css-invert's Introduction

css-invert

Simple command line tool to invert all the colors of a CSS file. Useful for making dark versions of light colored themes

I am someone who hates black text on white backgrounds. It makes me cringe, and my brain has a hard time actually focusing on text.

This was inspired by the Hacker Vision plugin, which does the same thing, only to any page on the internet. I needed a way to do this for my own web creations, as I have spent hours/days/weeks taking a default white theme for a CMS or something and manually transforming it into a dark theme, wishing so badly I could somehow save the inverted color schemes Hacker Vision so effortlessly made. Now I can, and you can too!

This was adapted from code I found in a post here, after searching forever for something like this http://stackoverflow.com/questions/2040848/automatically-convert-css-file-to-be-used-on-dark-backgrounds

To use it, make a copy of your css file ** and rename it to "invert-me.css"**

Then do this:

php css-invert.php 

That's all! Your site.css colors are all now inverted.

###Known issues This formats the code weird on the outputted files, and adds lots of spaces instead of line breaks where they should go.

You should run it through a beautifier like this http://html.fwpolice.com/css/

Also, I don't know php whatsoever.. so my attempt at making this morsel of code work on the command line is ugly and wrong. Any help would be welcome and super appreciated. Please fork and pull at will!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.