meteor-scss icon indicating copy to clipboard operation
meteor-scss copied to clipboard

@import global path cache "problem?"

Open josensanchez opened this issue 8 years ago • 9 comments

not entirely sure if its a cache problem, but, importing Core-ui I found several instances of "undefined variable"...

turn out to be that in the bootstrap/bootstrap.scss there is a

@import 'variables';

and after that, in core/core.scss also there is a line with

@import 'variables';

the second one is not evaluated (maybe because is cached from before).

I ended up copying the files to my project and changed this line to

@import './variables'; to search this resource in the same directory and everything works fine (well, repiting the same proccess in the rest of the files).

now, they use babel/webpack to transpile their module...

I think it would be nice to first search for @import 'some_resource' in the same directory and then try to get it from the global path, just for compatibility reasons to others compilers in order to be capable to import scss from third party modules

josensanchez avatar Oct 10 '17 12:10 josensanchez

The variable $card-border-radius-inner is not defined after all. With your tip and declaring of the variable it works for me.

ruohki avatar Oct 31 '17 17:10 ruohki

Hello,

Having the same issues as mentioned before. The $card-border-radius-inner seems not to be defined, so i switched it to $card-border-inner-radius which fixes that issue.

However, next I get an error that $gray-200 is not defined. If I hardcode the color in, i will get undefined for gray-300 and so on.

Trying to run this on fourseven:scss

ghost avatar Nov 07 '17 19:11 ghost

And changing

@import 'variables';

To

@import './variables';

Doesn't work for you @snowbane ?

josensanchez avatar Nov 07 '17 20:11 josensanchez

I have tried that, sadly it does not work.

ghost avatar Nov 07 '17 21:11 ghost

@josensanchez , where did you place your coreUI scss folder? Is it in meteor's client?

Any chance you could give me a breakdown of your folder structure?

ghost avatar Nov 08 '17 09:11 ghost

nop... if you put everything in the client folder, it would be evaluate following the meteor file load order and the imports would be a mess.

I place coreUI inside of the imports directory and in one main.scss on the client directory add the next lines

$card-border-radius-inner: 0px;

@import  '{}/imports/CoreUI-React/React_Starter/scss/style.scss';

well, something like that... we organize files differently, but if it's not clear, I'm talking about this file

https://github.com/mrholek/CoreUI-React/blob/master/React_Starter/scss/style.scss

josensanchez avatar Nov 09 '17 18:11 josensanchez

To resolve the issue:

  1. moved scss folder to imports/ui/scss
  2. removed syle.scss file
  3. created main.scss file in client folder with main.js & main.html with the following:

// start of main.scss @import "../imports/ui/scss/bootstrap-variables"; @import "../node_modules/bootstrap/scss/bootstrap"; @import "../imports/ui/scss/core-variables";

@import "../imports/ui/scss/core/variables"; @import "../imports/ui/scss/core/mixins"; @import "../imports/ui/scss/core/core";

@import "../imports/ui/scss/core/typography"; @import "../imports/ui/scss/core/animate"; @import "../imports/ui/scss/core/aside"; @import "../imports/ui/scss/core/avatars"; @import "../imports/ui/scss/core/badge"; @import "../imports/ui/scss/core/breadcrumb-menu"; @import "../imports/ui/scss/core/breadcrumb"; @import "../imports/ui/scss/core/buttons"; @import "../imports/ui/scss/core/callout"; @import "../imports/ui/scss/core/card"; @import "../imports/ui/scss/core/charts"; @import "../imports/ui/scss/core/dropdown"; @import "../imports/ui/scss/core/dropdown-menu-right"; @import "../imports/ui/scss/core/footer"; @import "../imports/ui/scss/core/grid"; @import "../imports/ui/scss/core/input-group"; @import "../imports/ui/scss/core/loading"; @import "../imports/ui/scss/core/mobile"; @import "../imports/ui/scss/core/modal"; @import "../imports/ui/scss/core/nav"; @import "../imports/ui/scss/core/navbar"; @import "../imports/ui/scss/core/progress"; @import "../imports/ui/scss/core/sidebar"; @import "../imports/ui/scss/core/switches"; @import "../imports/ui/scss/core/tables"; @import "../imports/ui/scss/core/widgets";

@import "../imports/ui/scss/core/layout"; @import "../imports/ui/scss/core/others"; @import "../imports/ui/scss/core/utilities"; @import "../imports/ui/scss/core/temp"; @import "../imports/ui/scss/core/rtl";

@import "../imports/ui/scss/custom"; // end of main.scss

anyone have a better way of doing this?

jwchia1 avatar Feb 13 '18 04:02 jwchia1

This issue happens because the core.scss does not start with '', so it is loaded before the others which start with '', so you get XXX is undefined error

shilu911 avatar Feb 24 '18 00:02 shilu911

This is really annoying. I am trying to combine font-awesome-pro with bootstrap, but because both define the same include names, things get messed up with a lot of undefined variables, although the imports come from different folders.

Is there any workaround for this? It makes combining complex sass libraries nearly impossible.

derwaldgeist avatar Aug 25 '19 18:08 derwaldgeist