Skip to content

Instantly share code, notes, and snippets.

@iamcarrico
Created January 21, 2016 21:00
Show Gist options
  • Save iamcarrico/310375de2d576198ffa9 to your computer and use it in GitHub Desktop.
Save iamcarrico/310375de2d576198ffa9 to your computer and use it in GitHub Desktop.
eq.js sample code, by @rupl
<div class="bio" data-eq-state="medium" data-eq-pts="medium: 412, large: 688">
<img src="path/to/my/face.jpg" alt="white male web developer">
<h2>Chris Ruppel</h2>
<p>a frontend developer who makes websites load fast and shrink on your phone.</p>
</div>
<div class="bio" data-eq-pts="medium: 412, large: 688">
<img src="path/to/my/face.jpg" alt="white male web developer">
<h2>Chris Ruppel</h2>
<p>a frontend developer who makes websites load fast and shrink on your phone.</p>
</div>
.bio {
// Default "small" bios have a linear layout.
// No styles needed.
// Medium/Large: we want name/desc to read
// like a sentence. Inline them and add the
// word "is" after the name.
&[data-eq-state$="medium"],
&[data-eq-state$="large"] {
h2, p {
display: inline;
}
h2 {
font-weight: 700;
}
h2:after {
content: " is ";
}
}
// Large: float the image to the left and bump
// the font size up a notch.
&[data-eq-state$="large"] {
font-size: 1.2em;
img {
float: left;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment