dwyl / dwyl/learn-react

Inline Styles?

Open
#14 17 comments 0 reactions 0 assignees View on GitHub
help wanted question
Dominant language
HTML
Stars
107
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Facebook _officially_ recommends that people define their
style as a JavaScript Object: http://facebook.github.io/react/tips/inline-styles.html
e.g:

``` js
var divStyle = {
color: 'white',
backgroundImage: 'url(' + imgUrl + ')',
WebkitTransition: 'all', // note the capital 'W' here
msTransition: 'all' // 'ms' is the only lowercase vendor prefix
};

ReactDOM.render(

Hello World!
, mountNode);
```

Does anybody else think that in-lining styles as JS inside Components is a **_debugging nightmare**_ waiting to happen (*as an app gets larger and new people add hacks & overrides to mask previous CSS instead of editing the CSS in the style sheet...?

![react-css-in-js](https://cloud.githubusercontent.com/assets/194400/12389043/5fea3058-bdce-11e5-97ab-d412bc4a40ef.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.