Function genStyleString

  • Generate the inline style string from the given parameters. The first parameter is the query selector, and the second parameter is the style array.

    Usage:

    const ret1 = genStyleString(".a", [ "color:red" ]);
    const ret2 = genStyleString("#b", [ "color:red", "font-size:12px" ]);
    console.log(ret1);
    console.log(ret2);

    Output:

    .a{color:red;}
    #b{color:red;font-size:12px;}
    

    Parameters

    • selector: string
    • styleArray: string[]

    Returns string

    The inline style string.