1.0.0 • Published 6 years ago

project-simple-red-css v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

RedCss

Simple Css Manager

License: MIT

NPM

github - here

Install

npm

npm install project-simple-red-css --save-dev
import RedCss from 'project-simple-red-css';

browser

<script src="https://project-simple.github.io/RedCss/dist/RedCss.min.js"></script>
<script>
    RedCss('body').S('background','red');
</script>

API

Css Search and make

  • RedCss('query string')
RedCss('body');

Set Css

  • RedCss('body').S('targetKey','targetValue');
RedCss('body').S( 'background','red' );
RedCss('body').S( 'color', 'pink', 'padding', 12 );
RedCss('div').S( 'marginLeft', '12em', 'margin-right', '12%' );  

equal

body { 
    background: red; 
    color : pink;
    padding: 12px;
}
div {
    margin-left: 12em;
    margin-right: 12%;
}

Get Css

  • RedCss('body').S( 'targetKey' );
// set
RedCss('body').S('background','red');
// get
RedCss('body').S('background'); // return red
  • Values declared in CSS are also controll by RedCss.
html {
    background: blue;
}
RedCss('html').S('background'); //return blue

Remove Css

  • RedCss('targetKey').remove()
RedCss('body').remove(); // remove body css

TestCase

1.0.0

6 years ago