fcf.styleToString() function
Package: fcf-framework-core
File: fcf-framework-core:fcf.js
Available from version: 2.0.2
Converts the a_name and a_value parameters to a string of the format `a_name : a_value`. For dimension values, automatically adds the ending "px";
Arguments
- Style name
- Style value
{a_name : a_value } a_descriptions
- Object with properties description
Result
- A string containing CSS properties and values
Example: Function application
{
let result = fcf.styleToString("color", "#aaa");
console.log(result);
}
{
let result = fcf.styleToString("width", 10);
console.log(result);
}
{
let result = fcf.styleToString({"width": 10, "color": "#aaa"});
console.log(result);
}
Output:
color: #aaa
width: 10px
width: 10px; color: #aaa