Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a variable for \00a0 unicode character for breadcrumb #16576

Closed
gniquil opened this issue Jun 2, 2015 · 12 comments
Closed

add a variable for \00a0 unicode character for breadcrumb #16576

gniquil opened this issue Jun 2, 2015 · 12 comments
Labels

Comments

@gniquil
Copy link

gniquil commented Jun 2, 2015

Currently, in the breadcrumb file:

    + li:before {
      content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space
      padding: 0 5px;
      color: @breadcrumb-color;
    }

Once it's transpiled to sass, then processed through a Sass engine, the slash in "\00a0" gets doubled to "\00a0" causing the breadcrumb to display incorrectly. We can easily factor this unicode out into a variable, which Sass will then properly escape it.

I will submit a PR for it. For reference, here are 2 issues downstream:

twbs/bootstrap-sass#911

lifegadget/ember-cli-bootstrap-sassy#22

@mdo
Copy link
Member

mdo commented Jun 2, 2015

Can it not be escaped inline?

@gniquil
Copy link
Author

gniquil commented Jun 2, 2015

According to this link:

http://stackoverflow.com/questions/21608762/sass-variable-interpolation-with-backslash-in-output

Sass has issue with it, hence the solution there is move the unicode character into a variable. :(

@kkirsche
Copy link
Contributor

kkirsche commented Jun 3, 2015

I haven't tested it myself but
http://stackoverflow.com/questions/21641833/how-to-use-a-single-backslash-in-string-interpolation-in-sass says

In Sass v3.3 you can get around this problem by using the new str-slice() function and doing something like this:

@mixin make-icon ($name, $code) {
  .#{$name}::before {
    content: str-slice("\x",1,1) + $code;
  }
}

@include make-icon('foo', 4556);

which should output:

.foo::before {
  content: "\4556";
}

EDIT:

Oops. The above is basically just mixin vs. variable as above solution. Sorry for the noise

I would think, though I don't know, that it would be possible to just use:

unescape-string("\\something");

@gniquil
Copy link
Author

gniquil commented Jun 3, 2015

You know what, I just reran boostrap-sass again and it seems the problem had gone away. Really not sure why, but I will close it for now. Sorry for the smoke :(.

@gniquil gniquil closed this as completed Jun 3, 2015
@xskif
Copy link

xskif commented Jun 10, 2015

The problem still there. I have double slashes in output.

@cvrebert
Copy link
Collaborator

@xskif Please open an issue in https://github.com/twbs/bootstrap-sass/issues with more details.

@orrd
Copy link

orrd commented Jun 17, 2015

@cvrebert Someone from bootstrap-sass already referred this issue from there "upstream" back to the main bootstrap repository here. It seems bootstrap and bootstrap-sass are both saying it's the problem of the other repository.

I'm having the same issue and am just hoping someone knows how to fix it.

@kkirsche
Copy link
Contributor

Broken link @orrd fixed link:
twbs/bootstrap-sass#911

@cvrebert
Copy link
Collaborator

I've asked @orrd to open a new (detailed) bug report in bootstrap-sass.

@mrliptontea
Copy link

There is very simple workaround, just replace interpolation with concatenation:

    + li:before {
      content: $breadcrumb-separator + "\00a0";
      padding: 0 5px;
      color: $breadcrumb-color;
    }

I think this could be noted for converter.

@IvanBernatovic
Copy link

@mrliptontea Thanks, that worked for me!

@cvrebert
Copy link
Collaborator

See twbs/bootstrap-sass#919

@twbs twbs locked and limited conversation to collaborators Aug 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants