The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

CSS Styles in a Rich-Text Editor

Hey fellow developers

I'm making an RTE and have come to the point where I'd like to integrate CSS support - that is, give the editing widgets (and, concurrently, the user of the editor) access to CSS styles, so you aren't just stuck with <strong>, <em>, and inline style attributes.

SO, what I need to know from you, as developers, is the preferred way of getting the styles to the script. I'm going to explain the options in detail here, and just give cursory labels for the poll

Add classNames to be used into a configuration file of the editor. Only classes specified here will be made available for editing.

Use a dedicated stylesheet just for the editor, in which all rules need to be used. This would be attached to the IFRAME's document, and could be @import-ed into the regular page so the same stylesheet can be used for editing and rendering.

Search all current stylesheets for rules that are a descendant of the editor's ID.

Specify styles in the config to be added inline on the HTML.

Other (specify)

A combination/choice of any of the above.

Please give some serious thought to this before responding - I want this to be something that works with the current zeitgeist of web development. Think about what the conditions under which you'd use this, and what would be best/easiest for those conditions.

I like the classNames option, but I think the RTE should also search any specified stylesheet for rules. Using only the classNames would leave your code marked up validly (if that's the intention in the first place), but would probably be a waste of classes when inheritance or good IDs can take its place. I'm voting for classNames + search stylesheet.

Off Topic:

Beetle, maybe change the radio buttons to checkboxes in the poll so people can vote for more than one option?