zavoloklom / material-design-typography

Material Design Typography LESS/CSS toolkit
MIT License
9 stars 6 forks source link

md-color package include paths continue throwing errors on compile #3

Open diosney opened 7 years ago

diosney commented 7 years ago

Hi, After abandon/rest on the project I was working on while I reported https://github.com/zavoloklom/material-design-typography/pull/1, I resumed work and tested what you did, but it keeps triggering a FileError error.

This is how I'm including the files i my project main files:

@bower-path:            '../public/vendors/bower_components';

@import '@{bower-path}/bootstrap/less/bootstrap.less';
@import '@{bower-path}/material-design-color-palette/less/variables.less';
@import '@{bower-path}/material-design-typography/less/material-design-typography.less';

and it triggers the error:

    Running "less:dev" (less) task
    >> FileError: 'bower_components/material-design-color-palette/less/variables.less' wasn't found. Tried - public/vendors/bower_components/material-design-typography/less/bower_components/material-design-color-palette/less/variables.less,less/bower_components/material-design-color-palette/less/variables.less,bower_components/material-design-color-palette/less/variables.less in public/vendors/bower_components/material-design-typography/less/material-design-typography.less on line 6, column 1:
    >> 5 // MD Color Palette
    >> 6 @import "bower_components/material-design-color-palette/less/variables.less";
    >> 7 @import "bower_components/material-design-color-palette/less/mixins.less";
    Warning: Error compiling less/main.less Use --force to continue.

I tried again with the PR https://github.com/zavoloklom/material-design-typography/pull/1/files, and worked fine this time too.

Maybe we can came to an understanding and fix this once for all? :smile:

Thanks in advance for your time and this library.

diosney commented 7 years ago

Maybe some variant of the following code can be used to make both paths work properly?

// MD Color Palette
@import (optional) "bower_components/material-design-color-palette/less/variables.less";
@import (optional) "bower_components/material-design-color-palette/less/mixins.less";

@import (optional, reference) "../../../bower_components/material-design-color-palette/less/variables.less";
@import (optional, reference) "../../../bower_components/material-design-color-palette/less/mixins.less";

My only concern with this code is when both the local and the external bower_components exists, but it seems that the case is very remote.

An update like this could help a lot, since I'm live-compiling the library in my project, not pre-compiling it since I'm changing lot of vars that affect the final output.