andreypopp / styling

Create CSS modules with the full power of JavaScript
130 stars 4 forks source link

Non-class element output? #2

Open KyleAMathews opened 9 years ago

KyleAMathews commented 9 years ago

E.g.

p {
  margin-bottom: 1.5rem;
}

I love all the JS->CSS stuff coming out but still find myself in every project needing to add a few global element styles.

andreypopp commented 9 years ago

It is possible but with no nice API.

Styling supports passing arbitrary CSS like this:

styling(`
p {
  margin-bottom: 1.5rem;
}
`)

which is of course suboptimal.

I'm open to API suggestions or better to a PR with implemented API :-)

KyleAMathews commented 9 years ago

That's a pretty good start. I just want to use JS to calculate colors, typography, etc. instead of relying on CSS preprocessors so this will work for now.