djhtml icon indicating copy to clipboard operation
djhtml copied to clipboard

SCSS indentation

Open DmytroLitvinov opened this issue 2 years ago • 2 comments

Related to #81

Hi @JaapJoris ,

Upgraded to 3.0.6 version and receive next indentation problem:

BEFORE:

.btn-secondary {
  @include button-variant(
    $secondary,
    $secondary,
    $color: $white,
    $hover-background: $primary,
    $hover-border: $primary,
    $hover-color: $white,
    $active-background: $primary,
    $active-border: $primary,
    $active-color: $white,
    $disabled-background: $primary,
    $disabled-border: $primary,
    $disabled-color: $white
  )
}

AFTER:

.btn-secondary {
  @include button-variant(
    $secondary,
    $secondary,
    $color: $white,
            $hover-background: $primary,
                       $hover-border: $primary,
                   $hover-color: $white,
                  $active-background: $primary,
                        $active-border: $primary,
                    $active-color: $white,
                   $disabled-background: $primary,
                          $disabled-border: $primary,
                      $disabled-color: $white
  )
}

You already mentioned possible solution to that case.

DmytroLitvinov avatar Mar 20 '23 18:03 DmytroLitvinov

The problem is that DjCSS treats text between ( and ) no different than ordinary attribute/value pairs in CSS. Note that the following:

@font-face {
    src: url('Arial.woff2') format('woff2'),
         url('Arial.woff') format('woff');
}

is consistent with the following, from DjCSS's perspective:

@include button-outline-variant(
    $color: $white,
            $hover-background;
)

This is a hard problem, but I think it can be fixed by special-casing stuff between ( and ).

JaapJoris avatar Jan 22 '24 20:01 JaapJoris

👀

SaulHormazabal avatar Aug 13 '24 16:08 SaulHormazabal