React-helmet: Add support for <style> tags in head for inline style rendering.

Created on 18 Apr 2016  路  5Comments  路  Source: nfl/react-helmet

There are css components and libraries out there that render <style>s inside head. Making these libraries inter-operate with helmet make for some non-optimal server-only logic.

Would it make sense to add support to <style> in Helmet? I'm guessing it would behave the same way <script> is behaving, except without the src attribute.

Most helpful comment

Nice!

Docs in readme are inaccurate though...

<Helmet
    style={{
        "cssText": `
            body {
                background-color: green;
            }
        `
    }}
/>

... throws an error. Should be...

<Helmet
    style={[{
        "cssText": `
            body {
                background-color: green;
            }
        `
    }]}
/>

All 5 comments

Thanks for the suggestion. Got a PR up now - #140

@cwelch5 awesome! Thanks for this.

Nice!

Docs in readme are inaccurate though...

<Helmet
    style={{
        "cssText": `
            body {
                background-color: green;
            }
        `
    }}
/>

... throws an error. Should be...

<Helmet
    style={[{
        "cssText": `
            body {
                background-color: green;
            }
        `
    }]}
/>

@KCraw Thanks! Fixed.

This has been released in [email protected]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattecapu picture mattecapu  路  4Comments

aravind12345 picture aravind12345  路  5Comments

jineshmehta16 picture jineshmehta16  路  3Comments

brianespinosa picture brianespinosa  路  3Comments

joshwcomeau picture joshwcomeau  路  3Comments