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

Is it possible to compile only mixins in scss? #2598

Closed
midorikocak opened this issue Jan 6, 2019 · 1 comment
Closed

Is it possible to compile only mixins in scss? #2598

midorikocak opened this issue Jan 6, 2019 · 1 comment

Comments

@midorikocak
Copy link

I have a scss file with some partial mixins. I want to compile only that mixin, without converting it to CSS. Let me show you the code.

@mixin baseButton() {
  position: relative;
  display: inline-block;

  &:disabled {
    background-color: gray;
  }
}

@mixin button($classname:".midori-button") {
  #{$classname} {
    color: gray;
    @include baseButton();
  }
}

@include button();

Is it possible compile this code into SCSS like the above but not into CSS like:

.midori-button {
  color: gray;
  position: relative;
  display: inline-block;

  &:disabled {
    background-color: gray;
  }
}

Thanks.

P.S: Not native.

@nex3
Copy link
Contributor

nex3 commented Jan 9, 2019

I'm sorry, this isn't possible. Sass is designed to compile to valid CSS, so it doesn't have any support for generating CSS extensions.

@nex3 nex3 closed this as completed Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants