Color names in strings are incorrectly replaced with hex values #80

Closed
fyhuang opened this Issue May 10, 2012 · 3 comments

Comments

Projects
None yet
4 participants
@fyhuang

fyhuang commented May 10, 2012

Using pyScss 1.3, from pip. Named colors in strings are incorrectly replaced by their hex values, for example:

body {
    font-format: "Black", "Crimson", "white";
}

Is compiled to:

body{font-format:"#000", "#dc143c", "#fff"}

Ruby scss correctly produces:

body {
  font-format: "Black", "Crimson", "white"; }

I specifically encountered this bug when trying to use the font "Crimson Text" on my website. Cheers!

@dtanabe

This comment has been minimized.

Show comment Hide comment
@dtanabe

dtanabe Jun 22, 2012

A workaround is to set the compress_reverse_colors option to False; this apparently disables substitutions from color names to hex values globally (which may or may not be desirable):

css = scss.Scss(scss_opts = {
    # Workaround for PySCSS improperly processing font names as colors
    'compress_reverse_colors': False
})

dtanabe commented Jun 22, 2012

A workaround is to set the compress_reverse_colors option to False; this apparently disables substitutions from color names to hex values globally (which may or may not be desirable):

css = scss.Scss(scss_opts = {
    # Workaround for PySCSS improperly processing font names as colors
    'compress_reverse_colors': False
})
@akissa

This comment has been minimized.

Show comment Hide comment
@akissa

akissa Oct 19, 2012

That does not fix it

parser = scss.Scss(scss_opts = {'compress_reverse_colors': False, 'compress': False})
parser.compile("""
@option compress: no;
@mixin mk_row($name, $color){
tr.#{$name}_row{
background-color:#{$color};
}
}
@include mk_row('white', '#FFFFFF');""")

'tr.#ffffff_row {\n background-color: #ffffff;\n}\n\n'

akissa commented Oct 19, 2012

That does not fix it

parser = scss.Scss(scss_opts = {'compress_reverse_colors': False, 'compress': False})
parser.compile("""
@option compress: no;
@mixin mk_row($name, $color){
tr.#{$name}_row{
background-color:#{$color};
}
}
@include mk_row('white', '#FFFFFF');""")

'tr.#ffffff_row {\n background-color: #ffffff;\n}\n\n'

@eevee

This comment has been minimized.

Show comment Hide comment
@eevee

eevee Jul 26, 2013

Collaborator

This is, at last fixed on master.

Collaborator

eevee commented Jul 26, 2013

This is, at last fixed on master.

@eevee eevee closed this Jul 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment