A program that takes Python classes and turns them into CSS classes.

Overview

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.

You might also like...
A program made in PYTHON๐Ÿ that automatically performs data insertions into a POSTGRES database ๐Ÿ˜ , using as base a .CSV file ๐Ÿ“ , useful in mass data insertions

A program made in PYTHON๐Ÿ that automatically performs data insertions into a POSTGRES database ๐Ÿ˜ , using as base a .CSV file ๐Ÿ“ , useful in mass data insertions.

Birthday program - A program that lookups a birthday txt file and compares to the current date to check for birthdays
Birthday program - A program that lookups a birthday txt file and compares to the current date to check for birthdays

Birthday Program This is a program that lookups a birthday txt file and compares

This program generates automatically new folders containing old version of program

Automated Folder Versions Generator by Sergiy Grimoldi - V.0.0.2 This program generates automatically new folders containing old version of something

Control System Packer is a lightweight, low-level program to transform energy equations into the compact libraries for control systems.
Control System Packer is a lightweight, low-level program to transform energy equations into the compact libraries for control systems.

Control System Packer is a lightweight, low-level program to transform energy equations into the compact libraries for control systems. Packer supports Python ๐Ÿ , C ๐Ÿ’ป and C++ ๐Ÿ’ป libraries.

Time tracking program that will format output to be easily put into Gitlab

time_tracker Time tracking program that will format output to be easily put into Gitlab. Feel free to branch and use it yourself! Getting Started Clon

The program converts Swiss notes into American notes
The program converts Swiss notes into American notes

Informatik-Programmieren Einleitung: Das Programm rechnet Schweizer Noten in das Amerikanische Noten um. Der Benutzer kann seine Note eingeben und der

Izy - Python functions and classes that make python even easier than it is

izy Python functions and classes that make it even easier! You will wonder why t

Macros in Python: quasiquotes, case classes, LINQ and more!

MacroPy3 1.1.0b2 MacroPy is an implementation of Syntactic Macros in the Python Programming Language. MacroPy provides a mechanism for user-defined fu

This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11.

This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11. It contains the following: The exceptiongroup.BaseExceptionG

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

    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.

    opened by JamminCoder 0
Owner
T.R Batt
Aspiring developer, tech enthusiast, quick learner. Python is my jam.
T.R Batt
poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions

poetry2nix poetry2nix turns Poetry projects into Nix derivations without the need to actually write Nix expressions. It does so by parsing pyproject.t

Nix community projects 405 Dec 29, 2022
a bit of my project :) and I use some of them for my school lesson or study for an exam! but some of them just for myself.

Handy Project a bit of my project :) and I use some of them for my school lesson or study for an exam! but some of them just for myself. the handy pro

amirkasra esmaeilian 13 Jul 5, 2021
A simple script written using symbolic python that takes as input a desired metric and automatically calculates and outputs the Christoffel Pseudo-Tensor, Riemann Curvature Tensor, Ricci Tensor, Scalar Curvature and the Kretschmann Scalar

A simple script written using symbolic python that takes as input a desired metric and automatically calculates and outputs the Christoffel Pseudo-Tensor, Riemann Curvature Tensor, Ricci Tensor, Scalar Curvature and the Kretschmann Scalar

null 2 Nov 27, 2021
Learning objective: Use React.js, Axios, and CSS to build a responsive YouTube clone app

Learning objective: Use React.js, Axios, and CSS to build a responsive YouTube clone app to search for YouTube videos, channels, playlists, and live events via wrapper around Google YouTube API.

Dillon 0 May 3, 2022
We'll be using HTML, CSS and JavaScript for the frontend

We'll be using HTML, CSS and JavaScript for the frontend. Nothing to install in specific. Open your text-editor and start coding a beautiful front-end.

Mugada sai tilak 1 Dec 15, 2021
This Program Automates The Procces Of Adding Camos On Guns And Saving Them On Modern Warfare Guns

This Program Automates The Procces Of Adding Camos On Guns And Saving Them On Modern Warfare Guns

Flex Tools 6 May 26, 2022
Virtual webcam that takes real webcam footage and replaces the background in order to have Virtual Backgrounds in MS Teams for Linux where the feature is unimplemented.

Background Remover The Need It's been good long while since Microsoft first released a Teams version for Linux and yet, one of Teams' coolest features

Dylan Turner 80 Dec 20, 2022
Weakly-Divisable - Takes an interger and seee if it is weakly divisible by seven

Weakly Divisble Project by Diana Arce-Hernandez, Ryan McAlpine, and Rommel Ravan

Diana Arce-Hernandez 1 Jan 12, 2022
A small script I made that takes any standard Decklist of magic the gathering cards and pulls all card images from scryfall at once!

A small script I made that takes any standard Decklist of magic the gathering cards and pulls all card images from scryfall at once!

null 15 Aug 26, 2022
Meera 2 May 12, 2022