poetic / meteor-materialize-sass-archived

Import materialize css as sass
19 stars 3 forks source link

Use in local package #18

Open palpinter opened 9 years ago

palpinter commented 9 years ago

Hí,

I,ve spent a half day to use this package in a local package without any success.

In the package.js:

api.use('fourseven:scss'); api.use('poetic:materialize-scss');

but how I can import: materialize.css?

@import "{poetic:materialize-scss}/bower_components/materialize/sass/materialize.scss";

obviously doesn't work, cause this is a relative path.

When I copy source scss files to package directory 'materialize.css' but @imports doesn't.

The fourseven:scss ha an issue: @import using relative paths #145 so relative path doesn't work.

But what is the right absolute path?

Thx PP

palpinter commented 9 years ago

Doesnt work on project level also

@import "{poetic:materialize-scss}/bower_components/materialize/sass/materialize.scss";

The error:

While processing files with fourseven:scss (for target web.browser): /client/index.scss: Scss compiler error: File to import: {poetic:materialize-scss}/bower_components/materialize/sass/materialize.scss not found. Import origin: /client/index.scss

Chun-Yang commented 9 years ago

Thank you for your error report, can you tell me your

  1. meteor version
  2. poetic:meteor-materialize-sass version
  3. fourseven:scss
palpinter commented 9 years ago

Hi,

meteor: api.versionsFrom('1.2.0.2'); 'fourseven:scss@3.3.3_1', 'poetic:materialize-scss@1.3.5'

However I1ve found an dirty workaround. I put all component to package.js, before materialize.scss, it works as expected.

Thx PP

Chun-Yang commented 9 years ago
  1. Did you make it work in the project level? It works find in my package.
  2. I have not tried using poetic:materialize-scss in a package before. Can you show me your package.js with the workaround? Thank you.
palpinter commented 9 years ago

Of course :)

Steps to reproduce:

  1. I've copied 'materialize.scss' from 'https://github.com/poetic/meteor-materialize-sass/tree/master/bower_components/materialize/sass' to my local package root.
  2. I've copied all components form 'https://github.com/poetic/meteor-materialize-sass/tree/master/bower_components/materialize/sass/components' to my local package '/components' folder.
  3. Add these files to my package.js ... 'fourseven:scss@3.3.3_1', 'poetic:materialize-scss@1.3.5' ...

    var scssFiles = [ 'components/date_picker/_default.date.scss', 'components/date_picker/_default.scss', 'components/date_picker/_default.time.scss', 'components/_buttons.scss', 'components/_cards.scss', 'components/_collapsible.scss', 'components/_color.scss', 'components/_dropdown.scss', 'components/_form.scss', 'components/_global.scss', 'components/_grid.scss', 'components/_icons-material-design.scss', 'components/_materialbox.scss', 'components/_material-icons.scss', 'components/_mixins.scss', 'components/_modal.scss', 'components/_navbar.scss', 'components/_normalize.scss', 'components/_prefixer.scss', 'components/_preloader.scss', 'components/_roboto.scss', 'components/_sideNav.scss', 'components/_slider.scss', 'components/_table_of_contents.scss', 'components/_tabs.scss', 'components/_toast.scss', 'components/_tooltip.scss', 'components/_typography.scss', 'components/_variables.scss', 'components/_waves.scss' ];

    ... api.addFiles(scssFiles); api.addFiles('materialize.scss'); ...

And your package works as expected. I know this is dirty hackish, but works.

Thx PP

shwaydogg commented 8 years ago

@palpinter I'm having the same issue, not able to import materialize.scss or _color.scss.

Could explain your hack fix i'm not clear on it?

Chun-Yang commented 8 years ago

@shwaydogg

  1. Please go to https://github.com/poetic/meteor-materialize-scss. This repo is deprecated.
  2. You can let user manually install this package. Or you can fork this package and write your package on top of this one. Or you can do what @palpinter suggested. If you have new ways to do this, please let me know.
shwaydogg commented 8 years ago

@Chun-Yang, Issues are turned off on the current repo! Are you able to turn them on‽ The current repo is the one I'm working with.

Chun-Yang commented 8 years ago

@shwaydogg Sorry about that. I just contacted the owner of our group to turn on the issues. We will have to wait.

  1. Are you using the new repo or the current one?
  2. Does it work if you use the package directly in an app instead of put it into another package?
shwaydogg commented 8 years ago

Thanks @Chun-Yang! Nothing to be sorry about! Just excitement that you saw my comment :).

  1. I was using the latest version that is published to meteor via: meteor add poetic:materialize-scss and I also git cloned the current repo at https://github.com/poetic/meteor-materialize-scss. I have not used the version we are currently talking on.
  2. I was never using in another package. I was using direct and trying to adding what the readMe suggests:
// If you want to override materialize sass variables you can uncomment the following:
// @import "{poetic:materialize-scss}/sass/components/_color.scss";
// $primary-color: color("blue", "lighten-2");

// import main scss file
@import "{poetic:materialize-scss}/sass/materialize.scss";

palpinter also noted that it happened to him on the project level in addition to within a package*

I had the same errors as him:

While processing files with fourseven:scss (for target web.browser):
/client/style/main.scss: Scss compiler error: File to import:
{poetic:materialize-scss}/bower_components/materialize/sass/_colors.scss

As far as I could tell only the font files were successfully exported as assets. {poetic:materialize-scss}/bower_components/materialize/sass/_colors.scss or ... materialize.scss were not in the .meteor directory.

Chun-Yang commented 8 years ago

Can you show me your Meteor version, poetic:materialize-scss version and fourseven:scss version? Mine: METEOR@1.2.1, poetic:materialize-scss@1.97.3_2, fourseven:scss@3.4.1

Chun-Yang commented 8 years ago

Also, you should not use the readme here, please read the readme on https://github.com/poetic/meteor-materialize-scss#scss. You are importing the wrong scss file.