wiki:Stylist

Stylist

Back to Plugins

The Xinha Stylist plugin provides a "Panel" containing various developer supplied context sensitive CSS styles. Using this plugin the user is able to apply (and remove) one or more CSS classes to the (possibly implicit) selection.

The plugin is "smart", that is, it will understand classes that are only valid within context. For example if you supplied the plugin the following style

li.important { color:red }

it would only be avaliable in the stylist when the cursor is in an <li> element.

Using the plugin is quite simple.

  editor.registerPlugin(Stylist);

  // We can load an external stylesheet like this - NOTE : YOU MUST GIVE AN ABSOLUTE URL
  //  otherwise it won't work!
  cfg.stylistLoadStylesheet('/mystyles.css');

  // Or we can load styles directly
  cfg.stylistLoadStyles('p.red_text { color:red }');

  // If you want to provide "friendly" names you can do so like this
  cfg.stylistLoadStyles('p.pink_text { color:pink }', {'p.pink_text' : 'Pretty Pink'});

  // or like this
  cfg.stylistLoadStylesheet('/mystyles.css', {'p.pink_text' : 'Pretty Pink'});

The plugin was developed by James Sleeman.

Last modified 12 years ago Last modified on 02/13/05 10:21:03

Attachments (1)

Download all attachments as: .zip