question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The Default Color names Conflict w/ SASS Interpolation

See original GitHub issue

WARNING on line 8, column 9 of /concise/components/_colors.scss: You probably don’t mean to use the color value white' in interpolation here. It may end up represented as #ffffff, which will likely produce invalid CSS. Always quote color names when using them as strings (for example, "white"). If you really want to use the color value here, use"" + $bg-color’.

My work-around was simply to add -color to the colors, so “green-color” and therefor also had to change the bg css settings and I think a few others.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

20reactions
keenanpaynecommented, Feb 7, 2015

@KamesCG

Does wrapping the color names in quotes fix this issue?

eg:

// Background colors
$bg-colors: (
  "white":  #ffffff,
  "black":  #222222,
  "gray":   #999999,
  "green":  #5cb85c,
  "blue":   #5bc0de,
  "yellow": #ed9c28,
  "red":    #d9534f
);
5reactions
frankdavidcoronacommented, Aug 20, 2019

@KamesCG Does wrapping the color names in quotes fix this issue? eg:

// Background colors
$bg-colors: (
  "white":  #ffffff,
  "black":  #222222,
  "gray":   #999999,
  "green":  #5cb85c,
  "blue":   #5bc0de,
  "yellow": #ed9c28,
  "red":    #d9534f
);

In my case I’ve this annotation: .#{$colorName}#{$hue}-bg { background-color: $color !important; }

How to fix?

Solved using this way: .#{''+$colorName+''}#{$hue}-border-bottom { border-bottom-color: $color !important; }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interpolation - Sass
Interpolation can be used almost anywhere in a Sass stylesheet to embed the result of ... from { background-color: yellow } to {...
Read more >
How to I solve this sass interpolation issue - Stack Overflow
Always quote color names when using them as strings or map keys (for example, "white"). If you really want to use the color...
Read more >
Sass Techniques from the Trenches | CSS-Tricks
Whatever naming convention you choose, the base idea is that every styled element gets its own class name, prepended with the component name....
Read more >
Sass (Syntactically Awesome StyleSheets)
:old forces the use of a colon before the property name. For example: :color #0f3 or :width $main_width . By default, either syntax...
Read more >
Sass/SCSS Variables Tutorial - KoderHQ
The color is generated as #fff because there is no other value for the variable, so it defaults to this one. Example: Compiled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found