I need a JavaScript program that will generate CSS code based on user inputs (from an HTML page). The user will enter values such as padding, margins, background color and the program will write the CSS for that.
The output will have two parts:
* Create the CSS that users can copy and paste to their CSS files.
* Update the CSS in the browser (DOM update) so that the design preview updates.
## Deliverables
This customization controls the display of CSS-only drop down menus. You can see a working example in the top navigation of http://wpml.org.
The CSS file that needs to be customized by the Javascript is this one:
[login to view URL]
The HTML page will contain sample HTML for a drop down menu, which will be styled by this CSS.
The user sees the example, with the default values (can be hard-coded in the HTML). When he edits the values and clicks UPDATE, the Javascript will:
1. Validate the format of the inputs and warn if there's a problem.
2. Create the CSS according to the user's input.
3. Update the DOM so that the example updates.
4. Update the CSS display that the user can copy.
The list of the properties that need to be styled is:
1. Padding
2. Background color
3. Font type
4. Font size
5. Font color
6. Checkbox to include a drop-down arrow for drop-down menus (I will supply the graphics).
7. Line height
These attributes should be specified for the top menus, selected top menu, drop-down menus and selected drop down menus.
I would need to receive two files:
1. The HTML file with the form input, sample drop-down menu and CSS output.
2. The Javascript that does the work.