Giter VIP home page Giter VIP logo

py-css's Introduction

PyCSS

What is it?

PyCSS is a micro-framework to speed up the process of writing bulk CSS classes.

How does it do it?

With Python!!!
First download the https://github.com/Jammin-Coder/py-css/tree/main/PythonCSS folder that contains the program files, then in that directory open the app.py file:
app py

Then within app.py and within the CSSClasses class, you write Python classes that translate into CSS:
css

Then you run compile.py with python3 compile.py -o <output_css_file>.css: The -o flag tells the program where to output the compiled CSS file.
Screenshot from 2021-08-02 18-36-47

Then open the css file and make sure it worked:
compiled_css

If you wish to only use a class to structer child classes, then you can place it outside CSSClasses
Screenshot 2021-08-03 153154
DFlex will not be compiled to the output file, but can be inherited by other classes.

You can also inherit properties from other classes:
inheritence

which turns into this:
compiled_inheritence

Then you can use the CSS file in any web-development project!

More docs to come.

Feel free to ask in the discussions tab if you have any problems or questions.

py-css's People

Stargazers

 avatar

Watchers

 avatar

py-css's Issues

GenerateClasses.py throws Type Error if CSS classes inherits a class that was already inherited earlier

class CSSClasses:
    class Padding:
        padding = "1em"

    class SeparateContent(Padding):
        padding = "2em" 
        margin = "2em"

    # This causes an error 
    class RandomClass(SeparateContent, Padding):
        # class content
        pass

TypeError: Cannot create a consistent method resolution
order (MRO) for bases object, Padding, SeparateContent

Preferably this should instead warn the user that the class inherits the same class twice, or find a way to join the
class attributes together systematically.

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.