Forum Moderators: open

Message Too Old, No Replies

Editing CSS using Javascript

         

Roudra

11:21 am on Nov 14, 2008 (gmt 0)

10+ Year Member



Hi All,

I am curently working on a tool to edit the css. I intend to have a HTML page which should load the specified CSS file and render the details. Post that when i make modifications to the design aspects like Font color, background color, etc the changes should be saved onto the css file that is refered, so that the next time i open the HTML, it should load with all the changes made. This has to be done using Javascript.

In short i need to modify the CSS using file handling at run time.
Please help me as to how to go about this task. I am very new to Javascripting and have very limited knowledge in JS...
Your help will be very highly appreciated.
Thanks

daveVk

10:37 pm on Nov 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will need to understand the CSS Dom and what the browsers support [quirksmode.org...]

Also look at CSS editing facilities in plugins like Web developer toolbar or firebug for firefox.

Roudra

9:18 am on Nov 21, 2008 (gmt 0)

10+ Year Member



Haven't been able to figure out anything substantial... Any help ...

daveVk

2:04 am on Nov 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try dividing the task into smaller tasks

I am curently working on a tool to edit the css.

How do you see yours differing from existing tools ?

I intend to have a HTML page which should load the specified CSS file and render the details.

Like all html pages work ?

when i make modifications to the design aspects like Font color, background color, etc

What sort of interface do you have in mind, is it just text editing the css, or do you intend to decode the css into some other editable display?

display the changes should be saved onto the css file that is refered

You can not do this in a general manner. If the CSS is on a remote server, you will to install something to handle the post on the server.

so that the next time i open the HTML, it should load with all the changes made.

The alternative is to change the css in place giving instant results ( important for fine adjustments ) and saving the css somehow at the end.