Giter Site home page Giter Site logo

stylesheet-stealer's Introduction

stylesheet-stealer

A script for formatting CSS stylesheets found on the internet into a standard, readable form.

Running the script

First off, make sure you are using Python 3.0 or later to ensure everyting works properly.

The main script file is parser.py. To run it, enter one of the following commands into the command prompt:

py parser.py <input-file-name> <output-file-name>

OR

py parser.py <input-file-name>

OR

py parser.py

Where <input-file-name> is an unformatted (or poorly formatted) CSS file and <output-file-name> is the file you want the program to generate. This output file will contain the formatted CSS code.

Note: As seen above, you may omit the output file name, or both the output file name and input file name. If both are omitted, the program attempts to open unformatted.css as the input file and formatted.css as the output file, ending the program if the input file is not found. If only the output file is omitted, the given input file is used, of course, as input and formatted.css is opened as the output file.

stylesheet-stealer's People

Contributors

wwlorey avatar

Watchers

James Cloos avatar

stylesheet-stealer's Issues

Tabbing lines correctly

Currently, lines are not tabbed over at all when the formatted CSS is generated. This change would include correct tabbing for media queries as well as normal CSS.

Extra space after selectors

There's an extra space following some selectors. See below.

.header .wrapper .page-title: hover {
color: #00896e
}

After .page-title: there's a space that shouldn't be there.

Media queries and curly braces

When processing media queries, extra newlines are added before closing curly braces. For example:

@media all and (max-width: 1000px) {
.reading-width {
max-width: 90vw
}


}

The above shows two extra newlines before the ending curly brace of a media query.

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.