Polished

Languages and libraries

css-in-js utility library

SHOW HN2017

Polished

A lightweight toolset for writing styles in JavaScript

github.com

#css-in-js#javascript styles#sass mixins#react styling

106points
48comments
#432of 2,242 in 2017
Top 20%of 2017 by points

How HN took it

MixedNo clear lean

3 positive, 8 neutral or asking, 1 mixed, 8 critical, out of 20 comments about the project. Thread score -0.21.

Idea: 3 for, 6 againstDocs: 0 for, 1 againstExecution: 0 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Fills a missing piece in the CSS-in-JS ecosystem

    From 1 comment
    • This was a big missing piece of code in the CSS-in-JS world. Thanks for providing the stdlib (following SASS is definitely a great approach).
      pygy_ on HN
  • Well thought-out low-level tool

    From 1 comment
    • I'm a massive CSS-in-JS skeptic but this is a very nicely thought out low-level tool for that stack. It's basically a JS version of SASS mixins (kinda). Most of my objections to…
      abritinthebay on HN

Objections

  • Color and shorthand utilities duplicate existing libraries or plain object syntax

    From 2 comments
    • > this seems to be a way to write the complete CSS in JS, and then to have it compiled into CSS. That isn't what this is although I also had to poke around the source code to…
      mbrookes on HN
    • Thanks for the clarification "SASS-like mixins for CSS in JS" sums it up. I did look at the docs, but that doesn't have an explanation of what value this is trying to offer…
      mbrookes on HN
  • CSS-in-JS adds style duplication and weakens consistency

    From 1 comment
    • This tool seems useful if you buy into the philosophy, but I'm just not sold yet - component based styling leads to a lot of style duplication and makes it very easy for a…
      debaserab2 on HN
  • Mixing styles into JavaScript is unappealing

    From 2 comments
    • The idea of writing CSS in JS is horrible to me. But I'm coming from a completely different developer camp, and find the vjeux talk completely unconvincing, so that does not mean…
      onli on HN
    • I'm coming around slowly but I still have a hard time with css being embedded in JS components. I have used SCSS for so long I am used to style and function being separate…
      analogmemory on HN

Requests

  • Add a How to use this section and better README

    From 1 comment
    • The idea of writing CSS in JS is horrible to me. But I'm coming from a completely different developer camp, and find the vjeux talk completely unconvincing, so that does not mean…
      onli on HN

Questions

  • What the project is and why use it over CSS

    From 2 comments
    • I'm not 100% what this is exactly... Care to clear it up a bit? At first I though this is for those situations where you find yourself urged to modify the css in your javascript.…
      onli on HN
    • > this seems to be a way to write the complete CSS in JS, and then to have it compiled into CSS. That isn't what this is although I also had to poke around the source code to…
      mbrookes on HN
  • Effect on browser style caching

    From 2 comments
    • Can somebody explain how this approach affects the style caching by the browser? It seems that this will just throw away all the caching optimizations built around that.
      juandazapata on HN
    • It is replaced by script caching. Loading the styles from JS rather than CSS is a bit slower, but not much.
      pygy_ on HN

Alternatives named

  • styled-components

    From 1 comment
    • That's exactly why we made styled-components![0] I really dislike writing styles as JavaScript objects, so styled-components let's you write actual CSS in JavaScript. We have…
      mxstbr on HN
  • Styletron

    From 1 comment
    • Also interesting, for people who fear style duplication: http://styletron.js.org
      k__ on HN
  • typestyle

    From 1 comment
    • I just discovered http://typestyle.io/ which should make it much easier to write CSS in JS... Auto-completion everywhere... I'll probably steal the approach for my own CSS-in-JS…
      pygy_ on HN
  • Sass/SCSS with BEM

    From 2 comments
    • What is the advantage of bringing your styling into javascript to do that? I do the exact same thing (I don't use BEM either) by isolating specific component styling to it's own…
      debaserab2 on HN
    • This tool seems useful if you buy into the philosophy, but I'm just not sold yet - component based styling leads to a lot of style duplication and makes it very easy for a…
      debaserab2 on HN
  • color.js and brehaut color-js

    From 2 comments
    • > this seems to be a way to write the complete CSS in JS, and then to have it compiled into CSS. That isn't what this is although I also had to poke around the source code to…
      mbrookes on HN
    • Thanks for the clarification "SASS-like mixins for CSS in JS" sums it up. I did look at the docs, but that doesn't have an explanation of what value this is trying to offer…
      mbrookes on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/13976707)