csstools / csstools/postcss-advanced-variables

Could not resolve the variable within mixin

Open
#80 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
144
Forks
33
PR merge metrics
No merged PRs in 30d

Description

I created a mixin with variables and `@if` like this;

```
@mixin grid($howmanycols: 2, $gap: 1.5rem){
display:grid;
grid-auto-rows:auto;
grid-gap:$gap;
@if $howmanycols == 2{
grid-template-columns:1fr 1fr;
} @else if $howmanycols == 3{
grid-template-columns:1fr 1fr 1fr;
} @else if $howmanycols == 4{
grid-template-columns:1fr 1fr 1fr 1fr;
}
}

.thing{
@include grid(2, 1.5rem);
}
```

https://www.sassmeister.com/gist/0a2d33972534af2cddd8323cc19e543b

Getting this error;
Fatal error: postcss-advanced-variables: /Users/bazzle/Documents/become a freelancer/site-design/css/input/main.css:12:15: Could not resolve the variable "$howmanycols" within "if $howmanycols == 3"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.