Skip to content

How to compile sass loop ? #1214

Closed
Closed
@webmasterpf

Description

@webmasterpf

Hello,

I've this kind of loop for my sass files (scss) and webpack encore doesn't compile them.

$typedecontenu: type-page-bts, type-TDC;
$zones: zone-1, zone-2, zone-3;
@each $zone in $zones {
  @each $type in $typedecontenu {
    ##{$zone}.#{$type} {

    & p,& ul,& li{
        @apply text-base p-1 list-inside;
    }
    & h2{
        @apply text-xl text-orange-fonce;
    }
    & h3{
        @apply text-lg text-orange-fonce;
    }
    & a{
        @apply no-underline text-orange-fonce hover:underline;
            }
  }/*  //Fin ##{$zone}.#{$type} */
} /*  // Fin @each $type */
} /* // Fin @each $zone */

the result is:

$typedecontenu: type-page-bts, type-TDC;
$zones: zone-1, zone-2, zone-3;
@each $zone in $zones {
  @each $type in $typedecontenu {

    ##{$zone}.#{$type} p,##{$zone}.#{$type} ul,##{$zone}.#{$type} li {
      list-style-position: inside;
      padding: 0.25rem;
      font-size: 1rem;
      line-height: 1.5rem;
    }
    ##{$zone}.#{$type} h2 {
      font-size: 1.25rem;
...

I'm using post-css, tailwind and plugins likethis: postcss config files

module.exports = {
  syntax: 'postcss-scss',
  plugins: {
    'postcss-import': {},// postcss-import needs to be first
    'tailwindcss/nesting': 'postcss-nesting',
    'postcss-cssnext' : {},
    tailwindcss: {},
    /* autoprefixer: {}, */    
  }
}

webpack config file:

 // enables Sass/SCSS support
    .enableSassLoader()

    // enables PostCSS support
    .enablePostCssLoader((options) => {
      options.postcssOptions = {
          config: './postcss.config.js',
      }
  })

What can I do more to get it compiled as the other scss code ?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions