preact-starter icon indicating copy to clipboard operation
preact-starter copied to clipboard

Why is style and javascript seperated

Open sp90 opened this issue 8 years ago • 5 comments

Hi again,

I just want to clarify why is scss/sass separated from javascripts, in components - is there a reason?

sp90 avatar Apr 10 '17 06:04 sp90

Hey, it's just my own preference. Before css modules/CSS-in-JS came along, this was the norm. I'd venture to say that in most circles, this still is the norm.

lukeed avatar Apr 10 '17 16:04 lukeed

No doubt, but it is a component based setup, which anyhow would make sense so you could grab a component folder at put it somewhere else right?

sp90 avatar Apr 11 '17 08:04 sp90

Yes, but your styles structure would (generally) match your views structure.

Just another way of doing things. Has no issue scaling in my experience. =]

The preact-boilerplate is nearly identical to this starter, with the exception of its css modules. Maybe that's what you're after?

lukeed avatar Apr 11 '17 08:04 lukeed

Nope there where greater losses - im just trying to understand your choices 👍

sp90 avatar Apr 13 '17 06:04 sp90

I might write a blog post on this 😲😛 I'm really against the practice in general.

// cc @zouhir

lukeed avatar Apr 13 '17 22:04 lukeed