• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

Software for Editing CSS files?

Segnosaur

Penultimate Amazing
Joined
Jan 18, 2002
Messages
21,815
Location
Canada, eh?
Wondering if anyone here can give me some suggestions...

I'm working on modifying a web application that uses CSS files. The original coder used embedded images within the application.

(For example, instead of calling an external file to be a background image, they use: background-image:url(data:image/gif;base64,<encoded text that looks like a bunch of giberish)

I'm trying to modify the file, but I'm running into certain problems:
- Visual Studio (10) crashes when I try to open the CSS file
- It appears that no line breaks were used, so opening the file in notepad or Jedit results in a single line or wall of text.

Does anyone have any suggestions for an editor (hopefully open source) that will allow me to modify the code? (I'd probably replace the inline images with an external file reference, but with the way things are formatted I can't even do that.) If possible, it would be nice if it had some sort of image preview feature so I can easily tell what image needs to be modified.

I have found many after a quick search (like snap and Amaya) but have no idea which ones are any good and/or have an image viewing capability.

Thanks in advance.
 
Of course, there's no editor better than vi (cue Emacs vs. vi discussion). ;)

vim (vi improved) is also available for Windows.
It has syntax highlighting, it can cope with such excessively long lines, and its support for regular expressions probably gives an edge in locating the places where you want to break the lines.

It has a bit of a learning curve though.
 
Thank you to the people who have responded.

I downloaded and tried Blue Griffen and Notepad++. They didn't seem to have the functionality I was looking for (or at least it wasn't obvious after playing around with them for a few minutes.)

I am pretty experienced with Vi; it had no problem reading in the long lines; the problem was it didn't format anything.

What I ended up doing is using Brackets. I had played around with it before, but after the suggestion here, I gave it a second try... It had a 'beautify' function that took the single line CSS and properly formatted it. (It becomes much simpler to read and modify now.)

One bit of functionality it doesn't seem to have is the ability to view the embedded graphics images.... so I'm still forced to go through the actual html, find the relevant tags, go through the CSS to find the matching tag, etc.
 
Thank you to the people who have responded.

I downloaded and tried Blue Griffen and Notepad++. They didn't seem to have the functionality I was looking for (or at least it wasn't obvious after playing around with them for a few minutes.)

If Blue Griffon didn't automatically re-format the CSS file when you opened it then it almost certainly doesn't have the capability of fixing a single line CSS mess.

Good to hear that Brackets has a function to fix it, I'll give it a try the next time I hit one of those messy single line CSS files (haven't hit one in many years).
 
In Notepad++ hit control-h to bring up the find/replace dialog. In search mode, tick Extended.
Find What ;
Replace with ;\n
replaces all semicolons with a semicolon and a new line. Replace ; with } and repeat etc
 

Back
Top Bottom