Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add manifest import paths as a variable #93

Closed
sonniesedge opened this issue Jun 7, 2016 · 5 comments
Closed

Add manifest import paths as a variable #93

sonniesedge opened this issue Jun 7, 2016 · 5 comments
Assignees

Comments

@sonniesedge
Copy link
Contributor

The import path is used in multiple places. It would make sense to variablise this.

@sonniesedge
Copy link
Contributor Author

Ah, there might be a problem with that: sass/sass#279

@planktonic
Copy link
Member

Could be fixed using the workaround here? sass/sass#279 (comment)

@sonniesedge
Copy link
Contributor Author

That's a runtime level workaround though. Not sure it's something that we can affect via the Bitstyles code. :(

@planktonic
Copy link
Member

Yes, that’s definitely true — it’d be required in the local project configuration.

So today’s findings: using https://github.com/bitcrowd/bitstyles/releases/tag/v0.2.1 (based on my PR replacing normalise with sass version), adding the node_modules to sass load path (reasonable expectation, have to do this in rails), and the bitstyles folder to the sass load path (less reasonable, but maybe ok for now):

'./node_modules/bitstyles/stylesheets',
'node_modules'

…and everything works well (requires npm v3+ presumably, not tested that yet).

The only other option I see right now is to use two different versions of the manifest (with different paths), but I’ll look into this more tomorrow.

@planktonic
Copy link
Member

Further findings after looking at how foundation & bootstrap do this:

Our options as I see it:

  • instruct users to set the path variable in their local project
  • instruct users to write @import '<location-of-bitstyles-here>/objects/blah';
  • provide manifest files in bitstyles that cover every eventuality for the location of node_modules/bower_components

The first of these seems the simplest and most robust — it’s one change for the local project, no added maintenance for bitstyles — and cross-package-manager-compatible.

This is how foundation sass does it (they provide CLI tools to automate that and the rest of the install process but also provide manual install instructions), and how most guides suggest using bootstrap-sass (the remaining guides I’ve read simply suggest @import 'node_modules/bootstrap-sass/scss/… for every import).

One potentially interesting point for the npm version — bootstrap v4 has a sass key in the package.json that specifies the location of the sass files within the repo. Combined with the location of node_modules (which also needs to be set if sass is to access any css in there) this could be used to create the loadpath, at least within an npm script (see this stack overflow question).

Right now though I’d suggest we keep it simple, and instruct users to add bitstyles to their loadpath in our readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants