RP12
RP12

Reputation: 428

How do I use a color variable in my SCSS color map in another SCSS file?

I have a shade of blue defined in a SCSS color map that I would like to use in a separate file. I am unsure of what the syntax is.

Here is the SCSS code:

$dm-blue: (
        "link":     #4EA0F9,
        "link-active":   #2FB0E1,
);

Here is the place in the other SCSS file that I would like to use the link-active shade.

border-bottom: 1px solid #2FB0E1;

I'd like to replace the #2FB0E1 with the link-active. What is the exact syntax to do that?

Upvotes: 1

Views: 305

Answers (1)

Alexander Nied
Alexander Nied

Reputation: 13623

Try this:

border-bottom: 1px solid map-get($dm-blue, "link-active");

map-get documentation.

Upvotes: 2

Related Questions