olavim / sass2jss

Convert sass to jss
5 stars 2 forks source link

Is this project suitable for production code? #1

Closed geochronology closed 4 years ago

geochronology commented 4 years ago

Hello, I just discovered your repo looking for a way to convert SCSS to JSS. Since this project was published quite recently (yesterday!), I was wondering if it's stable and suitable for writing production code, and if there are any bugs or issues I should be aware of. Thank you!

geochronology commented 4 years ago

Oops - was published yesterday of last year, my bad :)

olavim commented 4 years ago

I can't say how production ready this code is since there aren't many (if any) users. I created it as a helper for some small project of mine way back then since I couldn't find any existing projects for the problem.

The program itself is very simple: it reads an input sass file with node-sass, converts it to jss with jss-cli, and finally outputs the jss into a .js file.

While jss-cli might not look like a super popular project by its github stars, it was created by the jss team.

I'm ready to maintain this project if it's useful to you.

geochronology commented 4 years ago

Thanks for the reply! And I really appreciate that offer.

Can you provide me with a little more context on why you found the conversion useful in the first place?

I've been doing more research since my last comment and there are lots of different opinions around the optimal CSS stack, and so I'd be curious to know why you found CSS-in-JSS to be a better solution then working with the (S)CSS directly.

olavim commented 4 years ago

I'd be curious to know why you found CSS-in-JSS to be a better solution then working with the (S)CSS directly

Better is a strong word. But I do like working with JS objects in JS. If you use TypeScript, the available tooling is also much better than with pure SCSS. Auto-completion for class names? Count me in!

My original reason was that I had an existing SCSS stylebase, and wanted to convert it to JSS after adopting Material UI into my React project. Material UI uses JSS as its preferred styling method, so to me the path of least pain was to start using it.

All I needed was a tool that saves me time by not having to manually write all the SCSS styles as JavaScript objects. But what about you, why are you looking for an SCSS to JSS conversion tool?

geochronology commented 4 years ago

Great question. I am evaluating Material UI and found your solution after learning that MUI uses JSS by default.

However I have some issues with JSS, which lends itself toward inline styling and bloated component code.

Currently I'm leaning toward an SCSS solution using 7-1 architecture combined with CSS Modules and CSS Grid. This feels like the cleanest way to create a minimalistic and flexible design framework that I can build from scratch.

If I understand correctly, your choice to refactor was based on migrating to MUI. Is this correct?

On Sat, Feb 15, 2020, 5:02 AM Olavi Mustanoja notifications@github.com wrote:

I'd be curious to know why you found CSS-in-JSS to be a better solution then working with the (S)CSS directly

Better is a strong word. But I do like working with JS objects in JS. If you use TypeScript, the available tooling is also much better than with pure SCSS. Auto-completion for class names? Count me in!

My original reason was that I had an existing SCSS stylebase, and wanted to convert it to JSS after adopting Material UI https://material-ui.com/ into my React project. Material UI uses JSS as its preferred styling method, so to me the path of least pain was to start using it.

All I needed was a tool that saves me time by not having to manually write all the SCSS styles as JavaScript objects. But what about you, why are you looking for an SCSS to JSS conversion tool?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/olavim/sass2jss/issues/1?email_source=notifications&email_token=AM66HPDDIIBM3BOA2RVDHQDRC7RWZA5CNFSM4KTHG27KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL3KBII#issuecomment-586588321, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM66HPEIC4AABSTAAGWUHEDRC7RWZANCNFSM4KTHG27A .

olavim commented 4 years ago

If I understand correctly, your choice to refactor was based on migrating to MUI. Is this correct?

That's right, and has been the case numerous times. I usually start my projects with just some unorganized SCSS, and if the project grows enough I adopt MUI (due to familiarity) and run my existing styles through this program to minimize the migration time.