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

Support percentage dimensions #16

Open
Munter opened this issue Mar 4, 2015 · 4 comments
Open

Support percentage dimensions #16

Munter opened this issue Mar 4, 2015 · 4 comments

Comments

@Munter
Copy link
Member

Munter commented Mar 4, 2015

See this discussion: https://twitter.com/rachelnabors/status/573232079900581889

Resources: https://github.com/rachelnabors/pet-rachel https://github.com/rachelnabors/pet-rachel/blob/master/scss/_mixins.scss

http://rachelnabors.com/blackbrickroad/ and the style sheet is important: http://rachelnabors.com/blackbrickroad/css/styles.css

Example from stylesheet:

  /* line 112, ../sass/_mixins.scss */
  .photo7-scrap2 {
    background-position: 0 97.41567%;
    width: 1.15321%;
    padding-top: 1.15321%;
    height: 0;
    left: 16.72158%;
    top: 77.35%;
    -moz-background-size: 6171.42857% auto;
    -o-background-size: 6171.42857% auto;
    -webkit-background-size: 6171.42857% auto;
    background-size: 6171.42857% auto;
  }

  /* line 123, ../sass/_mixins.scss */
  .photo7 .scrap2 {
    background-position: 0 97.18663%;
    width: 71.16969%;
    padding-top: 22.40527%;
    height: 0;
    left: 13.34432%;
    top: 16.35%;
    -moz-background-size: 100% auto;
    -o-background-size: 100% auto;
    -webkit-background-size: 100% auto;
    background-size: 100% auto;
  }
@Munter
Copy link
Member Author

Munter commented Mar 4, 2015

@rachelnabors might be interested in when this lands

@Munter
Copy link
Member Author

Munter commented Mar 4, 2015

@rachelnabors is there a reason for using padding-top instead of height to define the height on the individual images?

@rachelnabors
Copy link

Ooooohyeaaaah there is. padding-top can let you define the "height" of an element in relationship to its parent's width. I'm working with designs now where I don't always know the parent element's width, so I've been using a pseudo-child element technique, as seen in the first reply here:

http://stackoverflow.com/questions/12121090/responsively-change-div-size-keeping-aspect-ratio

@rachelnabors
Copy link

A heads up, I use sprites in ways most people do not. But my sprites take a beating.

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

2 participants