Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Can not resolve @extend with @import #118

Open
zongwei007 opened this issue May 8, 2018 · 6 comments
Open

Can not resolve @extend with @import #118

zongwei007 opened this issue May 8, 2018 · 6 comments

Comments

@zongwei007
Copy link

I use precss 3.1.2 and found something strange like this:

//foo.scss
%foo {
  font-size: 12px;
}

//bar.scss
@import './foo';

.title {
  @extend %foo;
  float: left;
}

I expect result is:

.title {
  font-size: 12px;
  float: left;
}

But finally it is:

%foo {
  font-size: 12px;
}

.title {
  float: left;
}

I try to modified the index.bundle.js of precss, change variable plugins from

const plugins = [
	postcssExtendRule,
	postcssAdvancedVariables,
        ...
];

to

const plugins = [
	postcssAdvancedVariables,
	postcssExtendRule,
        ...
];

It seem to work well now.

@xmasong
Copy link

xmasong commented May 25, 2018

I met the same problem.

@xmasong
Copy link

xmasong commented May 25, 2018

Is there a temporary solution?@zongwei007

@xmasong
Copy link

xmasong commented May 25, 2018

I found [email protected] can solve this problem

@LVBoA
Copy link

LVBoA commented May 25, 2018

The front end da na has done a good job!

@zongwei007
Copy link
Author

@Song-Xiangming Yes, it just a temporary solution and need more testing. I use it in my private npm repository now.

@educarneiro
Copy link

This issue still persists. @extend is not being processed for imported files.

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

No branches or pull requests

4 participants