Skip to content

Instantly share code, notes, and snippets.

@phsantiago
Created May 31, 2016 19:12
Show Gist options
  • Save phsantiago/e073d696ace02b3c34360e5a060f0bb2 to your computer and use it in GitHub Desktop.
Save phsantiago/e073d696ace02b3c34360e5a060f0bb2 to your computer and use it in GitHub Desktop.
function Css() {
var regras = [];
function __constructor(){
$('head').append('<style type="text/css" custom></style>');
}
this.addRule = function(regra, conteudo) {
return $('style[custom]').append(regra + ' { ' + conteudo + ' } ');
};
this.updateRule = function(regra, conteudo) {
return $('style[custom]').text(regra + ' { ' + conteudo + ' } ');
};
__constructor();
}
var css = new Css();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment