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

Background optimisation #150

Closed
dhunkin opened this issue Oct 3, 2013 · 5 comments
Closed

Background optimisation #150

dhunkin opened this issue Oct 3, 2013 · 5 comments
Assignees
Milestone

Comments

@dhunkin
Copy link

dhunkin commented Oct 3, 2013

background: none was optimised to background: 0 which is wrong in some cases.
The difference is in background-position. "background: none" sets all background properties to initial values, so "background-position" will be "0 0". "background: 0" however sets background-position to "0 50%". This ca be easily verified with Firebug or CSS editor built into Chrome.

@GoalSmashers
Copy link
Contributor

@dhunkin not sure if we are on the same page but could you please check this fiddle: http://jsfiddle.net/S3GtV/

If you uncomment the last line in stylesheet then it clearly does not set background position to 0 50% but rather removes the image altogether. Thoughts?

@dhunkin
Copy link
Author

dhunkin commented Oct 3, 2013

Sure, but please try to add this to styles:
body {
background:url(https://pro.goalsmashers.com/images/public/what-is-it-1-91331e81d6e9b7c6f0c4237c57d1db7d.png) 100% 100% no-repeat;
height:100%;
background:0;
background-image:url(https://pro.goalsmashers.com/images/public/what-is-it-1-91331e81d6e9b7c6f0c4237c57d1db7d.png);
}
and you will see, that image has position-y at 50%, but with background:none - 0% as expected

@GoalSmashers
Copy link
Contributor

@dhunkin got it! It indeed does have incorrect position-y so apparently background:none should be shortened to background:0 0 or left as it is.

@ghost ghost assigned GoalSmashers Oct 3, 2013
GoalSmashers pushed a commit that referenced this issue Oct 4, 2013
* Apparently background:0 does not set y position to 0 but 50%.
@GoalSmashers
Copy link
Contributor

@dhunkin 1.1.3 is out with fix to this issue - thanks for all your help!

GoalSmashers pushed a commit that referenced this issue Oct 4, 2013
* Apparently background:0 does not set y position to 0 but 50%.
@antife-yinyue
Copy link

background:0; is also ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants