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

Quoting problem with function return #1217

Closed
kavika13 opened this issue Oct 25, 2015 · 2 comments
Closed

Quoting problem with function return #1217

kavika13 opened this issue Oct 25, 2015 · 2 comments

Comments

@kavika13
Copy link

I saw this change when upgrading from a somewhat older version of node-sass to the most recent version from npm.

Zurb foundation (latest version) includes a function to create [data-<attribtue>] selectors. These were compiling fine in the old version of node-sass, but aren't anymore.

Here's a somewhat minimal repro:

@function data($attr) {
  @return '[data-' + $attr + ']';
}

form {
  #{data('abide')} {
    span.error, small.error { display: none; }
  }
}

Expected result (based on old version on my box/Zurb compiled css source from the distro):

form [data-abide] span.error, form [data-abide] small.error {
  display: none; }

Actual result:

form "[data-abide]" span.error, form "[data-abide]" small.error {
  display: none; }

These quoted selectors break in Chrome (and might not work anywhere).

Let me know if this is a bug. If it is by design then I'll tell Zurb to change their function to use unquote, or whatever other method you advise to fix this on their end. If it is an upstream bug, let me know that too and I'll go post in libsass or SassC :)

@xzyfer
Copy link
Contributor

xzyfer commented Oct 25, 2015

Thanks for the repotr @kavika13. I can confirm this is a regression in LibSass. I've created an issue with them, please subscribe to it there for updates.

sass/libsass#1624

@xzyfer
Copy link
Contributor

xzyfer commented Jan 20, 2016

This is fixed in the upcoming 3.5.0-beta. Subscribe to #1349 for further updates.

@xzyfer xzyfer closed this as completed Jan 20, 2016
@xzyfer xzyfer modified the milestone: next.libsass Sep 4, 2016
jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
Ruby Sass explicitly unquotes the results of interpolations in
selectors. This patch is very thorough but it address all the
use cases I think of and it fixes the regression causing people
issues.

Fixes sass#1217
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants