0.0.4 • Published 5 years ago

jsson v0.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

js-style-builder-class

Json object(who included camelCase css attribute) transform to inline css content. for Text's attributes only

Usage

const customStyle = {"color":"#000"
"fontFamily":"Roboto"
"fontSize":32
"fontStyle":"normal"
"fontWeight":400
"textAlign":"center"
"textTransform":"capitalize"
}

const inlineCss = new StyleBuilder(customStyle).render();

// text-align: center; text-transform: capitalize; font-weight: 400; font-style: normal; font-size: 32px; font-family: Roboto; color: #000;




const inlineCss = new StyleBuilder(customStyle).textAlign('left').fontWeight(700).render();

// text-align: left; text-transform: capitalize; font-weight: 700; font-style: normal; font-size: 32px; font-family: Roboto; color: #000;




const inlineCss = new StyleBuilder(customStyle);

if(customStyle.fontWeight > 300) {
  inlineCss.fontStyle('italic');
}

inlineCss.render();

// // text-align: center; text-transform: capitalize; font-weight: 400; font-style: italic; font-size: 32px; font-family: Roboto; color: #000;

Roadmap

  • ES5 build
  • Validate attribute values
  • Extend attribute scope
0.0.4

5 years ago

0.0.35

5 years ago

0.0.34

5 years ago

0.0.33

5 years ago

0.0.32

5 years ago

0.0.31

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.122

5 years ago

0.0.1

5 years ago