I would suggest a combination of a few things:
- use lots of namespaced/prefixed classes, i.e.
plugin-checked plugin-active
- create a default stylesheet that will give the correct styles to the correct classes when no other styles are applied to the page.
- Use inline-styles for ui-animations that are always the same (not a lot of choice in this, if it's animating, inline styles be a-changing).
- Provide good documentation on what classes are applied to what elements and when.
This will allow more advanced developers to use their own stylesheet, or expand on your stylesheet to make the desired format, it will also give developers hooks to override their default styles if they've done something silly like div a {float:left;}
.
You can be very specific in your default stylesheet, specifying every rule for every element, but that tends to be entirely unnecessary as it's more trouble than it's worth.
Avoid making a plugin that restricts development, try instead to make a plugin that simplifies development.
As an HTML5 solution that may or may not be supported (no idea what browsers support this yet), you could add a set of styles to a container via a style
element with the scoped
attribute (go figure, scoped styles). It could contain a simplified HTML reset, but this whole system is more likely to restrict you later on when you want to override something and have to get into a specificity fight.