Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scss variable $background-color overwritten, cannot use inside page scss #8475

Closed
MarkChrisLevy opened this issue Oct 4, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@MarkChrisLevy
Copy link
Contributor

MarkChrisLevy commented Oct 4, 2016

Short description of the problem:

When scss variable $background-color is used inside page scss file the value is not taken from variables.scss, it appears that somewhere in the ionic scss files are overwritten.

What behavior are you expecting?

If $background-color variable was set in variables.scss it should remain unchanged (if not changed by developer on purpose of course).

Steps to reproduce:

  1. ionic start --v2 test
  2. in theme/variables.scss set $background-color to #bb6996
  3. in pages/home/home.scss write page-home { background-color: $background-color; }
  4. ionic serve
  5. when page loaded in the browser, open chrome/firefox developer tools, see what is the value of background-color property of page-home element - it should be #bb6996, but it is not, the color is #69BB7B, which is the default value of "favorite" color (from colors list defined in variables.scss)

Other information:
I'm not an expert in sass, but it seems, that somewhere in ionic scss files the global background-color variable is overwriten, likely when loop on colors is made and that is the reason why $background-color is set to last color from $colors.

Which Ionic Version? 1.x or 2.x
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1

@MarkChrisLevy MarkChrisLevy changed the title scss variable $background-color (possibly others) overwritten, cannot use inside page scss scss variable $background-color overwritten, cannot use inside page scss Oct 4, 2016
@jgw96 jgw96 added css labels Oct 4, 2016
@brandyscarney
Copy link
Member

Hey, thanks for the issue! I was able to reproduce this using the conference app. You are correct! It seems that we are reusing the $background-color name in some of our component loops which is overriding the variable when you try to use it. I'll look into fixing this.

@brandyscarney brandyscarney self-assigned this Oct 28, 2016
@brandyscarney brandyscarney added this to the 2.0.0-rc.2 milestone Oct 28, 2016
@MarkChrisLevy
Copy link
Contributor Author

@brandyscarney Thanks! You are great!

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants