Coder Social home page Coder Social logo

pesticide's Introduction

Pesticide

Kill your CSS layout bugs. Without 2000 clicks in Chrome Dev Tools.

WTF is this?

Sometimes if I am trying to sleuth a layout problem in CSS, all I want is every single element on the page to show me where its outline is. And I want all the outline colors to be different per element because, well sometimes I need to tell stuff apart. The pesticide toggle has proved much faster for me than clicking around in browser dev tools when trying to uncover what CSS is causing me problems.

Pesticide demo

Getting started

If you like pre-processing your CSS like I do, you can drop any of the Sass, Less, or Stylus partials into your includes. Each version of Pesticide sets a pair of debug variables at the top of the partial, which you can set to false if you want to turn off outlines and depths (i.e., shadows) respectively:

// sass
$pesticide-debug-outline: false;
$pesticide-debug-depth: false;
// less
@pesticide-debug-outline: false;
@pesticide-debug-depth: false;
// stylus
pesticide-debug-outline = false
@pesticide-debug-depth = false

If you like to use vanilla CSS, you can either keep it commented out at the bottom of your CSS file, or include it as an extra request in the head of your HTML file like so...

<link rel="stylesheet" href="pesticide.css">

Make sure not to send it to production though because that wouldn't be the best.

Enjoy. And feel free to make the color scheme prettier and send a pull request :)

Development

If you want to tweak the source code you might find it useful to use some of the available gulp tasks included with the project. To set up automation with gulp just press the following keys:

cd pesticide
npm install -g gulp
npm install

Because Pesticide comes in Sass, Less, and Stylus flavors, you can adjust gulp to run with your pre-processor of choice. To do so, simply change the preProcessor variable at the top of the gulpfile to either sass, less or stylus as a string value. For example:

preProcessor = 'sass';

Then run npm start. That will set up:

  • Browser-sync (livereload changes in the browser)
  • Stylesheet compilation
  • CSSLint
  • CSS minification

It's important to note that Sass is the default pre-processor set in the gulpfile, so if you plan to use Less or Stylus, you should change the preProcessor value before running gulp.

Generating the color table

The default color table is automatically generated and exported for the different pre-processors we support. To generate the color table simply run:

gulp generate

If you want to generate your own custom color table:

COLOR_TABLE=path/to/custom/table.json gulp generate

Chrome Extension

The source for the Pesticide Chrome extension is included beginning from v0.2. The extension is available in the Chrome Web Store here.

If you make changes to the extension within this repo and want it pushed up to Chrome, report an issue and mention @paulmolluzzo to make sure I get an email about it.

Firefox Add-on

Pesticide is also available as a Firefox Add-on

Author

MRMRS

Contributors

Built and iterated by the following nice people

License

The MIT License (MIT)

Copyright (c) 2014 @mrmrs

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.

pesticide's People

Contributors

paulmolluzzo avatar colindresj avatar kirkas avatar exalted avatar cvrebert avatar cvan avatar beaufortfrancois avatar joshijitendra avatar rafaelrinaldi avatar xhmikosr avatar

Watchers

James Cloos avatar Tyler Cote avatar

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.