Skip to content
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

@elseif is supported? #67

Open
kono-paku opened this issue Dec 20, 2018 · 3 comments
Open

@elseif is supported? #67

kono-paku opened this issue Dec 20, 2018 · 3 comments

Comments

@kono-paku
Copy link

Hi, I found out the similar issue below.
#8

But it appears that @if and @else works fine, not @elseif.
Is there anyone to checkout this issue.

$theme-type: test1;

@if $theme-type == test1 {
  background: #000000;
} @else if $theme-type == test2 {
  background: #DDDDDD;
}  @else {
  background: #FAFAFA;
}

By the way, this plugin is so great.
Thanks for providing the great plugin!

@maxmilton
Copy link
Contributor

There's no mention of @elseif in the docs or tests, so no, it's not supported. You can of course use nested @if conditionals:

@if $theme-type == test1 {
  background: #000000;
} @else {
  @if $theme-type == test2 {
    background: #DDDDDD;
  }  @else {
    background: #FAFAFA;
  }
}

@kono-paku
Copy link
Author

kono-paku commented Dec 22, 2018

A nested clause deteriorates legibility of source code.
I wrote down the souce below which is a bit weird but easy to understand.

@if $theme-type == test1 {
  background: #000000;
}

@if $theme-type == test2 {
  background: #DDDDDD;
}

@if $theme-type == test3 {
  background: #FAFAFA;
}

@kono-paku
Copy link
Author

I would be nice if there is @elseif keyword.

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

No branches or pull requests

2 participants