oddbird / accoutrement

Combined Sass Accoutrement tools, with option for individual module imports
MIT License
37 stars 6 forks source link

tokens.get() incorrectly returns null in some cases #100

Closed johncrim closed 2 years ago

johncrim commented 2 years ago

Description

fix(null for existing token): Handle color references in token values

Previously, tokens.get() incorrectly returned null depending on the value of the token. This occurred when the token value contained a hash (#) followed by text. Now, the hash and text remain in the token value if there is no token matching an #alias reference. This handles cases like #rrggbb within an unquoted string.

The previous behavior was a regression from accoutrement 3.x, so I don't think the docs or changelog need updating for this fix.

fixes: #99

Steps to test/reproduce

New tests included in the PR to repro the issue. If you revert the changes, the new tests fail.

johncrim commented 2 years ago

Hi @mirisuzanne - please take another look when you have time.

After addressing your feedback, I realized I could make another simplification - next-alias() doesn't need to include the start key, since it is no longer used. We could put it back in if you think there's any other utility for having the start index.