Form To CSS - jQuery-Plugin form to CSS generator

Overview

Form to CSS generator Builder | jQuery Plugin

Create your own CSS generator with the form to css generator Builder plugin. Can be usefull to create your own css builder or a Wordpress plugin or any kind of apps you need a real time css generator. For example, you can create a button generator


Demo page | build A CSS generator like this in minutes:

Why

I wanted to create my own CSS generator for a project with a form that update dynamically the css. I looked to some other project and i didn't liked the fact to write a lot of codes and i came up with a idea to create a form who automatically convert to CSS.

Usage example

HTML form (input, textarea and select tags supported):
Read the jQuery.serializeJSON for more details.

input name with body[background-color]

">
<input type="text" name="body[background-color]" value="yellow">

CSS Output:

body {
    background-color: yellow
}

input name with h3[font-size]:px

">
<input type="text" name="h3[font-size]:px" value="15" />

CSS Output:

h3 {
    font-size: 15px
}

For multiple class or ID since we use jQuery.serializeJSON, you can not separate selector with a comma, instead use | like the following example: input name with multiple selector .firstclass|secondClass[font-size]:px

">
<input type="text" name=".firstclass|secondClass[font-size]:px" value="15" />

CSS Output:

.firstclass, .secondClass {
    font-size: 15px
}

Multiple input with the same selector will build your CSS:

">
<input type="number" name=".firstclass[font-size]:px" value="15" min="1" max="20" />
<input type="text" name=".firstclass[color]" value="#cccccc" /> 

CSS Output:

.firstclass {
    font-size: 15px;
    color: #cccccc;
}

Since jQuery.serializeJSON do not take the : as a selector, we replace : by @ input name with #myID@hover[color] It may change in the futur if i can implement CSS media queries.

">
<input type="text" name="#myID@hover[color]" value="red" />

CSS Output:

#myID:hover {
    color: red
}

user :skip or anything:skip to exclude input from being converted to CSS (from jQuery.serializeJSON)

Adding units to value

After the value, you can specify units to value

[]:px []:em []:percent []:important []:pximportant []:emimportant []:percentimportant

">
<input type="text" name=".myclass[padding]:em" value="2" />

OR

">
<input type="text" name=".myclass[padding]:emimportant" value="2" />

percent for %

important for !important

Using FormtoCSS function

Call the function this way. You can use a Class, ID or form

$(".formClass").formtoCSS();

With all options:

Example call with all options:

Tricks:

Sometime you need to append something to your input and formtoCSS did not update your CSS.

try .keyup():

$("#targetInput").val('#f43').keyup();

You can use hidden input and do create CSS with the right name informations

Dependency

Form to CSS need these javascript and jQuery plugins to work.

The cssparser add css3 prefix like -moz | -webkit
The cssparser need to be rewrite. I found it on the web and it's not perfect.

Demo:

https://jsfiddle.net/onigetoc/92fp0brf

Full page demo

You can fork and help for this project.


github.io/FormToCSS

Markdown created with Editconvert

You might also like...

Create your own password generator using jQuery, Vanilla JS, and SASS.

Password Generator Create your own password generator using jQuery, Vanilla JS, and SASS. I have been working with JS for my last few projects so I th

Jul 12, 2021

JQuery charCounter - jQuery Character Counter Plugin

JQuery charCounter - jQuery Character Counter Plugin

jQuery Character Counter A jQuery based character counter for input and textarea HTML tags. What is this? This simple plugin allows you to add a c

Aug 10, 2022

jQuery quick notification plugin. jQuery плагин быстрых уведомлений

Note: English translation by Google Translate Notific About Description: this is a jQuery plugin that helps you display notifications on your site. Li

Nov 7, 2021

Dynamic form elements generate with jQuery

Dynamic form elements generate with jQuery

Demo Advance Form Demo. Basic Form Demo. script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"/script script src="https:/

Dec 13, 2022

A meme generator plugin for Figma and FigJam. Import memes from all over the internet with customizable captions and share it far and wide.

A meme generator plugin for Figma and FigJam. Import memes from all over the internet with customizable captions and share it far and wide.

Is This A Meme? 💁🏻 🦋 A meme generator plugin for Figma and FigJam. Import memes from all over the internet, add your captions, and share it far and

Aug 30, 2022

A variety of jQuery plugin patterns for jump starting your plugin development

jQuery Plugin Patterns So, you've tried out jQuery Boilerplate or written a few of your own plugins before. They work to a degree and are readable, bu

Dec 31, 2022

This is a simple Image popup Jquery plugin. With a very simple configuration, you can show a popup on your webpage. By the way, this plugin works after page load.

This is a simple Image popup Jquery plugin. With a very simple configuration, you can show a popup on your webpage. By the way, this plugin works after page load.

Jquery-SingleImagePopup This is a simple Image popup Jquery plugin. With a very simple configuration, you can show a popup on your webpage. By the way

Aug 22, 2022

CSS Generator has a lot of tools 😉 🎉 👀

CSS Generator has a lot of tools 😉 🎉 👀

Css Generator 😃 Packages used in Project : React Router Dom Framer Motion react-color react-icons react-awesome-button Preview Tools 🔨 Background to

Dec 31, 2022

A jQuery plugin that works in harmony with animate.css in order to enable animations only when content comes into view.

jQuery AniView A jQuery plugin that works in harmony with animate.css in order to enable animations only when content comes into view. Now supports v4

Sep 10, 2022
Owner
Gino
Web developer, programer, Wordpress developer
Gino
Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator Types generator is a utility tool that will help User to create TS Interfaces from JSON. All you have to do is paste your single objec

Vineeth.TR 16 Dec 6, 2022
A jQuery plugin to make your form controls look how you want them to. Now with HTML-5 attributes!

(jQuery) Uniform A jQuery plugin to make your form controls look how you want them to. Now with HTML-5 attributes! Works well with jQuery 1.6+, but we

Audith Softworks 2.2k Jan 2, 2023
The jQuery plugin for validation and post form data to server

NiceForm The jQuery plugin for validation and post form data to server (http://ducdhm.github.io/jquery.niceform/) Shortcuts Dependencies Rules Configu

Duc Doan (Bobby) 17 Jul 27, 2022
A jQuery plugin that creates a countdown timer in years, months, days, hours and seconds in the form a bunch of rotating 3d cubes

CountdownCube is a jQuery plugin that is in the form of a bunch of rotating 3D cubes. It uses CSS transitions to create the 3D rotating cube effects.

null 16 Mar 6, 2022
jQuery-plugin for add/remove dom-items with renaming form-elements (arrays)

dynamicrows jQuery-plugin for add/remove rows by cloning existing row / renaming form-elements (arrays). Requirements jQuery >=2.0 if move-action used

Dennis Dohle 0 Nov 9, 2020
Auth-Form-Design - Beautiful Auth Form Designed using React 🥰.

?? Auth Form Design ?? Features 1. Check Your Password Strength 2. Can Use Suggested Password 3. Enjoy Responsive Design Getting Started with Create R

Samarpan Dasgupta 2 Dec 24, 2022
Gatsby-Formik-contact-form-with-backend-panel - Full working contact form with backend GUI panel.

Gatsby minimal starter ?? Quick start Create a Gatsby site. Use the Gatsby CLI to create a new site, specifying the minimal starter. # create a new Ga

Bart 1 Jan 2, 2022
This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreadsheet.

HtmlFormApp Overview This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreads

Kanshi TANAIKE 18 Oct 23, 2022
FormGear is a framework engine for dynamic form creation and complex form processing and validation for data collection.

FormGear is a framework engine for dynamic form creation and complex form processing and validation for data collection. It is designed to work across

Ignatius Aditya Setyadi 91 Dec 27, 2022
A JavaScript library stores the form-data to the localstorage so you don't have to fill the form again.

form-storage A JavaScript library stores the form-data to the localstorage so you don't have to fill the form again. Installation via npm npm install

appleple 159 Dec 10, 2022