Skip to content

Sass color functions are not case insensitive #214

@SamyCookie

Description

@SamyCookie
In [12]: sass.compile(string='a { b { color: lighten(crimson, 10%); } }')
Out[12]: u'a b {\n  color: #ed365b; }\n'

But if you use uppercase letters in colors (allowed by CSS specification), it fails :

In [13]: sass.compile(string='a { b { color: lighten(Crimson, 10%); } }')
---------------------------------------------------------------------------
CompileError                              Traceback (most recent call last)
<ipython-input-13-2066632bd1a9> in <module>()
----> 1 sass.compile(string='a { b { color: lighten(Crimson, 10%); } }')

/usr/local/lib/python2.7/dist-packages/sass.pyc in compile(**kwargs)
    638         raise TypeError('something went wrong')
    639     assert not s
--> 640     raise CompileError(v)
    641 
    642 

CompileError: Error: argument `$color` of `lighten($color, $amount)` must be a color

       Backtrace:
        stdin:1, in function `lighten`
        stdin:1
        on line 1 of stdin
>> a { b { color: lighten(Crimson, 10%); } }
   ---------------^

Sass Ruby version is working well with some uppercase syntax.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions