Ejemplo de styleSheetsHelper.js
<style>
.rojoAmarillo {color:red; background-color: yellow}
</style>
<style>
.rojoAmarillo {margin:1em;color:black}
</style>
<script src="../styleSheet.js"></script>
<script>
// consulta una clase de stylesheets o style tag
styleSheetsHelper.getStyleString('.rojoAmarillo'); // regresa: color:black;background-color:yellow;margin:1em;
styleSheetsHelper.getStyleObject('.rojoAmarillo'); // regresa: { color: "black", "background-color": "yellow", margin: "1em" }
// cambia la clase de stylesheets o style tag
styleSheetsHelper.setStyle('.rojoAmarillo', 'color:white;background-color:black;padding:1em;border:1px yellow solid');
styleSheetsHelper.getStyleString('.rojoAmarillo'); // regresa: color:white;background-color:black;margin:1em;padding:1em;border:1px solid yellow;
// agrega una clase
styleSheetsHelper.setStyle('.nuevaClase', "color:blue;padding:1em;margin:2em;width:80%;text-align:center;");
styleSheetsHelper.getStyleString('.nuevaClase'); // regresa: color:blue;padding:1em;margin:2em;width:80%;text-align:center;
// Existe la clase?
styleSheetsHelper.exists('.noExiste'); // regresa: false
styleSheetsHelper.exists('.rojoAmarillo'); // regresa: true
</script>
empece red/yellow, luego black/yellow y debo ser white/black con border amarillo
Clase creada con styleSheetsHelper
styleSheetsHelper.setStyle('.nuevaClase', "color:blue;padding:1em;margin:2em;width:80%;text-align:center;");
Debo ser con letra azul y centrado
Ojo el style string debe estar bien escrito, igual que en css,
del contrario el error y posiblemente despues de el no se consideran.
Abrir la consola y ver page source.