roots / sage

WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow
https://roots.io/sage/
MIT License
12.77k stars 3.06k forks source link

Bug: Failed to compile CSS/SCSS When curly braces is present on css class as dynamic value for mixin #3122

Closed makolivaresbbt closed 1 year ago

makolivaresbbt commented 1 year ago

Terms

Description

Currently, we have a mixin function that generates content based on how the user uses it.

@mixin headings($from: 1, $to: 6) { @for $i from $from through $to { h#{ $i } { @content; } } }

If you notice the h#{ $i }, the curly braces return the error below image

Below are the dependencies that we have

"devDependencies": { "@roots/bud": "^6.9.0", "@roots/bud-eslint": "^6.9.0", "@roots/bud-prettier": "^6.9.0", "@roots/bud-sass": "^6.9.0", "@roots/bud-stylelint": "^6.9.0", "@roots/eslint-config": "^6.9.0", "@roots/bud-entrypoints": "6.9.0", "@roots/bud-postcss": "6.9.0", "@roots/sage": "6.9.0" },

Steps To Reproduce

  1. Install Sage Theme
  2. Install depencies below: "devDependencies": { "@roots/bud": "^6.9.0", "@roots/bud-eslint": "^6.9.0", "@roots/bud-prettier": "^6.9.0", "@roots/bud-sass": "^6.9.0", "@roots/bud-stylelint": "^6.9.0", "@roots/eslint-config": "^6.9.0", "@roots/bud-entrypoints": "6.9.0", "@roots/bud-postcss": "6.9.0", "@roots/sage": "6.9.0" },
  3. Add a mixin that contains curly braces on css Class. ex: @mixin headings($from: 1, $to: 6) { @for $i from $from through $to { h#{ $i } { @content; } } }
  4. Yarn Build

Expected Behavior

Since this is a SCSS function, this should be working perfectly image

Actual Behavior

image but the issue render this error

Relevant Log Output

No response

Versions

Sage 10

retlehs commented 1 year ago

Let's use your existing support topic on Roots Discourse for the back-and-forth on this — Sage doesn't include Sass out of the box, so this is either an issue with our docs or upstream in bud