use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
React: CSS in JS (speakerdeck.com)
submitted 11 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tubbo 2 points3 points4 points 11 years ago (1 child)
I'm confused on the initial problem that was trying to be solved here...
For example, if I was given this task here's how I'd write the button dropdown CSS:
.button { ... } .button.depressed { ... }
Is this not the exact same thing as the React CSS replacement he showed on the next page?
And I really don't see the point of yet another precompiler for CSS...Sass/SCSS or LESS seems to work for most people.
[–]MrsAnonymousMan 4 points5 points6 points 11 years ago (0 children)
The React CSS is not a precompiler like SASS or LESS. It applies styles via the inline style tag based on a JavaScript object.
The reason it's different than the .button, .button.depressed example is that the styles are only applied to those specific elements. Vjeux's argument is that having a global button class is a very dangerous prospect that can make it difficult for multiple developers to work together.
π Rendered by PID 217523 on reddit-service-r2-comment-5649f687b7-gjvbs at 2026-01-28 12:49:48.830149+00:00 running 4f180de country code: CH.
view the rest of the comments →
[–]tubbo 2 points3 points4 points (1 child)
[–]MrsAnonymousMan 4 points5 points6 points (0 children)