Skip to content

Instantly share code, notes, and snippets.

@dennisfrank
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennisfrank/51e6f8724f98f49ffcf4 to your computer and use it in GitHub Desktop.
Save dennisfrank/51e6f8724f98f49ffcf4 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
/*
* Works
*/
// Works as expected
@mixin okay($foo: bar) {
[data-attribute="#{$foo}"]:before,
[data-another-attribute="#{$foo}"]:after {
content: "Okay!";
}
}
/* Expected Output */
[data-attribute="bar"]:before,
[data-another-attribute="bar"]:after {
content: "Okay!";
}
/* Actual Output */
@include okay;
/*
* Doesn’t work
*/
// When adding another line with a class `.#{$foo}:before`
// the line break between the two data-attribute selectors
// gets replaced by an \a. This breaks the CSS. :(
@mixin not-okay($foo: bar) {
.#{$foo}:before,
[data-attribute="#{$foo}"]:before,
[data-another-attribute="#{$foo}"]:before {
content: "There is an \a in the generated CSS!";
}
}
/* Expected Output */
.bar:before,
[data-attribute="bar"]:before,
[data-another-attribute="bar"]:before {
content: "There is an \a in the generated CSS!";
}
/* Actual Output */
@include not-okay;
@charset "UTF-8";
/*
* Works
*/
/* Expected Output */
[data-attribute="bar"]:before,
[data-another-attribute="bar"]:after {
content: "Okay!";
}
/* Actual Output */
[data-attribute="bar"]:before,
[data-another-attribute="bar"]:after {
content: "Okay!";
}
/*
* Doesn’t work
*/
/* Expected Output */
.bar:before,
[data-attribute="bar"]:before,
[data-another-attribute="bar"]:before {
content: "There is an \a in the generated CSS!";
}
/* Actual Output */
.bar:before,
[data-attribute="bar"]:before, \a [data-another-attribute="bar"]:before {
content: "There is an \a in the generated CSS!";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment