Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow style keys to be strings #9

Closed
maksimsco opened this issue Jun 15, 2015 · 1 comment
Closed

Allow style keys to be strings #9

maksimsco opened this issue Jun 15, 2015 · 1 comment

Comments

@maksimsco
Copy link

In general it works, however some values are incorrectly post-fixed with "px".

const style = Stilr.create({
    header: {
        'z-index': 9999
    }
});

This style will be converted to:

.header{z-index:9999px}
@chriskjaer
Copy link
Contributor

This would actually be a react issue since Stilr uses React's own css handler (https://github.com/facebook/react/blob/master/src/renderers/dom/shared/CSSPropertyOperations.js) internally to convert js objects to css strings.

Also, I would always recommend using camelCase. Since it's the normal way to interact with style properties in plain old javascript. e.g.

document.querySelector('.button').style.zIndex = 9999;
// or
document.querySelector('.foo').style.backgroundColor = 'tomato';

...and it saves you 3 key strokes ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants