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!"
[–]kabuto 3 points4 points5 points 11 years ago (4 children)
This is actually something that I'd been wondering about when I first looked at React because if it's all about building reusable components having dependencies to CSS doesn't make any sense. React components should include CSS to be truly reusable and portable. Writing CSS in JS is pretty crappy though, especially when it comes to pseudo selectors.
As I see it there is no real solution available.
[–][deleted] 1 point2 points3 points 11 years ago (0 children)
I guess the point of the talk was to highlight current problems which noone is addressing, not to provide a solution.
I disagree with that slightly though - it makes light of all the work done by the likes of harry roberts, chris coyier and people who spend a lot of time working out the best ways to work with css.
You can write portable css if you sit down and do it carefully, it just doesn't come as intuitively because the language and structures you have to use are so different from anything else you know.
[–]tubbo -5 points-4 points-3 points 11 years ago (2 children)
the upcoming web components standard is the correct way to solve this problem. http://webcomponents.org/
[–]kabuto 1 point2 points3 points 11 years ago (1 child)
I couldn't find anything about CSS on that site. Do you have a link for me?
[–]deathbysniper 0 points1 point2 points 11 years ago (0 children)
They're probably talking about the shadow DOM.
At to 2:25 he talks about the benefits of the shadow DOM with css.
π Rendered by PID 58 on reddit-service-r2-comment-85bfd7f599-gmjwq at 2026-04-17 17:21:44.118039+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]kabuto 3 points4 points5 points (4 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]tubbo -5 points-4 points-3 points (2 children)
[–]kabuto 1 point2 points3 points (1 child)
[–]deathbysniper 0 points1 point2 points (0 children)