Any good resources on using Bitters with Ember? Hopefully a codebase with some of the defaults changed, using some of the mixins and functions…
I’ve installed it on this project and got the defaults working, which is already a great improvement, but am lost on how to add and change stuff from there, being very out of date with css and a newbie with sass.
Anything I add to app.scss seems to make ember serve / build barf with a segmentation fault, even just basic styles.
Hi @oliverbarnes, it seems your project is not actually compiling changes to scss.
I am far from being an expert with using Ember and the conventions required by ember-cli, but I believe bitters should be installed to the vendor dir and imported from app.scss. Then you probably need to add an output tree for this to work (I am referring to the docs in broccoli-sass)
Thanks @pedromoreira that does help. One thing though, I did manage to get a change I made to render - I changed the button color at app/styles/bitters/_button.scss. So changes to the bitters files themselves get compiled but not whatever is on app.scss? The defaults are getting compiled as well…
Vendor does seem the right place for it though, going to try moving it there and see if the segfault goes away
var app = new EmberApp({ sassOptions: { includePaths: require('node-neat').with('app/assets/bitters') } });
5. This gives away the last step Install the Bitters files in app/assets/bitters. Just cd into app/assets and run bitters install
6. Declare your imports in app.scss:
@pedromoreira is there a reason you use npm to install neat and not just put everything in the app/styles directory? I originally just put the thoughtbot stack in the app/styles directory, and everything seems to be working great. I however did this as a first shot to get it working, and haven’t changed it since then because, hey, it was working!
Works! Many thanks Pedro. I ended up keeping bitters under app/styles though, to avoid creating yet another directory under app/.
@dolphorama I had them under app/styles before, and they loaded, but when I tried adding any custom styles, there would a segmentation fault on building. requiring with neat fixes that, somehow
@dolphorama, I’m not quite sure but I do believe the reason for npm’ing it is to get node sass to properly compile it. Maybe some thoughtbot folks can present a solid explanation for this.
@oliverbarnes, no problem, glad to help! I might put this into a blog post
Yeah. Without taking the time to sit down and completely understand whats happening behind the scenes with Broccoli and asset compilation in ember-cli it can sometimes feel like magic. I don’t like when something feels like magic. I guess I have a project now for the weekend!