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.

ColorHelper 3.0 Showing Previews for SCSS/SASS variables that are the same as an HTML color name

See original GitHub issue

Description

After upgraded to ColorHelper 3.0, I see the following in a .scss file:

An SCSS variable $blue includes has the HTML color blue's swatch after the $

$blue is an SCSS/SASS variable for a color and is not a reference to the HTML color “blue”:

Definition of $blue variable shows correct color

This was correctly not highlighted in previous versions. It would be awesome if the correct color was shown (#142), but I’d be more than happy to just not have this highlighted.

Support Info

  • ST ver.: 3211
  • Platform: windows
  • Arch: x64
  • Plugin ver.: 3.0.0
  • Install via PC: True
  • coloraide ver: 0.1.0a7
  • mdpopups ver.: 4.0.2
  • markdown ver.: 3.2.2
  • pygments ver.: 2.1a0
  • jinja2 ver.: 2.10.1

Steps to Reproduce Issue

Use any SCSS variable with a name that matches a named HTML color as a CSS property value.

color: $blue;
color: $tomato;
color: $rebeccapurple;
color: $darkgoldenrod;

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
facelessusercommented, Mar 12, 2021

I have a fix 🙁.

Screen Shot 2021-03-12 at 3 21 29 PM

We just need to make sure our trigger for color words doesn’t have a $ before it:

(?:\b(?<![-#&$])[\w]{3,}(?!\()\b
0reactions
facelessusercommented, Mar 12, 2021

Thanks! If all the missed bugs are just like this, I’ll be pretty happy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for SCSS (SASS) Variables Coloring #101 - GitHub
Is there any chance of Color Helper supporting SCSS (SASS) variable coloring throughout the files? The main variable declaration is colored, ...
Read more >
My RGB variables are not working on SCSS/SASS
scss color: rgb(var(--main__blue));. I don't want to declare the variable as RGB (in which would solve my problem), because I want later on...
Read more >
Build A Responsive Website With HTML & SCSS/SASS, Full ...
Build a fully responsive website with SASS/SCSS.This complete tutorial on how to build a responsive website with HTML and SCSS/sass.
Read more >
Colors - Documentation | CodyHouse
Learn how to set colors and create color themes in CodyFrame. ... each HSL value separately, we can combine SASS color functions and...
Read more >
The Ultimate Guide to Learning Sass/SCSS
The Ultimate Guide to Learning Sass/SCSS. Variables, nesting, partials, modules, mixins, inheritance, operators, and more.
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