1

I have 2 SASS var colors:

$red: '#F06292';
$lightPurple: '#8F6894';

Code:

<style lang="scss">
@import url('https://fonts.googleapis.com/css?family=Inconsolata|Oswald');

$red: '#F06292';
$lightPurple: '#8F6894';

#app {
  font-family: 'Inconsolata', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  font-family: 'Oswald', sans-serif;
  color: #B987C0;
}

#nav {
  padding: 30px;
  a {
    font-weight: bold;
    color: $lightPurple;  // <--
    &.router-link-exact-active {
      color: $red;  // <--
    }
  }
}
</style>

Markup:

<template>
  <div id="app">
    <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link>
    </div>
    <router-view/>
  </div>
</template>

Result:

enter image description here

And if I just change $red back to red:

&.router-link-exact-active {
  color: red;
}

enter image description here

In the browser it gave this style to my links instead: color: -webkit-link;

enter image description here

The rest of my sass is working, like indentation, thought I haven't tried mixins yet. Any thoughts here?

6
  • 1
    You forgot to add the markup. Commented Mar 29, 2019 at 1:08
  • Sorry, just added! @AndreiGheorghiu Commented Mar 29, 2019 at 1:17
  • 1
    What do the element styles look like in your browser console? Commented Mar 29, 2019 at 1:18
  • @Phil added! Yeah it gave this strange style: color: -webkit-link; Commented Mar 29, 2019 at 1:21
  • If you hover that little yellow triangle, what does it say? Commented Mar 29, 2019 at 1:21

1 Answer 1

3
$red: '#F06292';
$lightPurple: '#8F6894';

should be

$red: #F06292;
$lightPurple: #8F6894;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.