-
Notifications
You must be signed in to change notification settings - Fork 64
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
Doesn't find mixin #120
Comments
@IvanSavoskin thanks for opening the issue, can you provide a minimal reproducible example (or, a failing test case)? Based on the code provided, I'm not sure what the file structure is, what the problematic line of code is, or what options were being passed. |
src/styles/theme/mainTheme.scss $app-height: 300px;
$content-height: 200px; src/styles/theme/newTheme.scss $app-height: 600px;
$content-height: 500px; src/styles/mixin.scss @use "sass:map";
@use "src/styles/themes/mainTheme" as main;
@use "src/styles/themes/newTheme" as new;
$themes: (
main: (
app-height: main.$app-height,
content-height: main.$content-height
),
smartMarket: (
app-height: smartMarket.$app-height,
content-height: smartMarket.$content-height
)
);
@function themed($key) {
@return map-get($theme-map, $key);
}
@mixin themify($themes: $themes) {
@each $theme, $map in $themes {
:global(.theme-#{$theme}) & {
$theme-map: () !global;
@each $key, $submap in $map {
$value: map-get(map-get($themes, $theme), '#{$key}');
$theme-map: map-merge($theme-map, ($key: $value)) !global;
}
@content;
$theme-map: null !global;
}
}
} src/component/styles/App.scss
|
There is an assumption that the construction @use "src/styles/variables" as variables;
.name {
color: variable.$color // Error here "Invalid CSS after "...olor: variables": expected expression (e.g. 1px, bold), was ".$color !important""
} A similar error occurs also in the mixin.scss file |
I tried to replicate this issue based on comments but it worked as expected for me. The file name listed was I'm closing this issue without a reproducible example. Feel free to open a new issue with a link to a minimal reproduction repo. |
A mixin is created in a separate file. I import this mixin into various scss files via
@use "src / styles / mixin" as *;
Expected Behavior
Everything works correctly, files with style declarations are created
Current Behavior
I get the error
no mixin named themify
orInvalid CSS after "... nt-height: main": expected expression (eg 1px, bold), was ". $ Content-height,"
and no ad files are generated or appearSteps to Reproduce (for bugs)
mixin.scss
mixin usage
Your Environment
The text was updated successfully, but these errors were encountered: