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

Combined limitation: No ability to import CSS from vendored libraries into sass. #289

Closed
nathanhammond opened this issue Apr 7, 2014 · 2 comments

Comments

@nathanhammond
Copy link
Contributor

It is currently impossible to inline-include CSS from a vendored library using broccoli-sass.

  1. libsass has no methodology for forcing file inclusion of .css files.
  2. The linking fix that went in to protect against data loss seems to prevent something like this from working:
    ln -s vendor/normalize-css/normalize.css app/styles/normalize.scss
  3. Copying and pasting code from vendor should be discouraged.

Full reproducible copy/paste into terminal test scenario:

npm install -g ember-cli@0.0.22
ember new symlinktest
cd symlinktest
npm install --save-dev broccoli-sass
bower install normalize-css
# Workaround for https://github.com/joliss/broccoli-sass/pull/8
sed 's/preprocessCss(appAndDependencies/preprocessCss(appAndDependencies.inputTrees/g' Brocfile.js > tmp.js
rm Brocfile.js
mv tmp.js Brocfile.js
cd app/styles
ln -s ../../vendor/normalize-css/normalize.css normalize.scss
rm app.css
touch app.scss
echo "@import 'normalize';" >> app.scss
cd ../../
ember server

We need either:

  1. A specified design pattern to account for this use case. (This would be an ember-cli issue, why this is filed.)
  2. Address this as a bug in Broccoli. (Theoretically the data-loss issue only applicable to folders, so symlinking as I did should be "okay".) (This would probably be a broccoli-kitchen-sink-helpers or broccoli-filter issue.)

If we're ignoring 1 from above, feel free to close this. :)

/cc @joliss

@stefanpenner
Copy link
Contributor

now that the core of cli is approaching some stability, the addon story (including the issues you mention) will become our priority. Thanks for outlining the problem so nicely

@nathanhammond
Copy link
Contributor Author

I now have a better understanding of the issue. When I make the symlink I'm doing this:

normalize.scss -> ../../vendor/normalize-css/normalize.css

When Broccoli pushes everything into the temporary directories the relative path symlink is no longer accurate. Presumably this worked previously because of hardlinks to the directories. This really isn't an ember-cli issue.

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