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

@extend not compiling in css #122

Open
kayetter opened this issue Sep 6, 2018 · 2 comments
Open

@extend not compiling in css #122

kayetter opened this issue Sep 6, 2018 · 2 comments

Comments

@kayetter
Copy link

kayetter commented Sep 6, 2018

Here is my simple css

%bee-color {
  background: blue;
}

#bee-cluster-1 {

  .bee-1 {
        @extend %bee-color;

  }
}

This is compiling to

#bee-cluster-1 .bee-1 { @extend %bee-color: ; }

Which gives me an unnamed property error in browser. Setting it with an @include mixin will result in correct compiling.

@diverent2
Copy link

Running the current version 4.0.0, it works fine for me.

//compiles to

#bee-cluster-1 .bee-1 {
    background: blue
}

Please consider upgrading to a newer version and provide your project version next time for better debugging :)

PS: In my experience 🐝s are rather black and yellow/gold, and so are their hives, but that´s just my experience ^^

@dyllandry
Copy link

dyllandry commented Aug 12, 2019

Fix for me: Don't put : after @extend. 😭 Will leave this here for others to maybe find useful.


Hmm, it's not transforming for me either. I'm using [email protected].

This...

%constrain-content-width {
  max-width: 1100px;
  margin: 0 auto;
}

.header {
  @extend: %constrain-content-width;
}

compiles to...

.header {
  @extend: %constrain-content-width;
}

Variables are compiled fine, though. I just can't get extend to work.

If it helps, I am using PostCSs & precss in the context of Hugo. So, the way I'm using it is this:

<head>
  ...
  {{ $style := .Resources.GetMatch "styles.pcss" | resources.PostCSS (dict "use" "precss") }}
  <style>{{ $style.Content | safeCSS  }}</style>
</head>

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

3 participants