Skip to content

Instantly share code, notes, and snippets.

View LeaVerou's full-sized avatar

Lea Verou LeaVerou

View GitHub Profile
@LeaVerou
LeaVerou / dabblet.css
Created December 20, 2011 22:14
Fit in viewport demo
/**
* Fit in viewport demo
*/
img {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
@LeaVerou
LeaVerou / dabblet.css
Created December 26, 2011 20:41
Frosted glass effect with filters
/**
* Frosted glass effect with filters
*/
* { padding: 0; margin: 0 }
body, html { min-height: 100%; }
body, div:after {
background: url('http://devslovebacon.com/images/bacon-bg.jpg') center;
}
@LeaVerou
LeaVerou / dabblet.css
Created December 31, 2011 18:44
Animation with one keyframe
/* Animation with one keyframe */
html { background: white }
body {
width: 100px; height: 100px;
background: slategray;
}
html:hover > body {
animation: 1s animation infinite;
@LeaVerou
LeaVerou / dabblet.css
Created January 1, 2012 17:04
The -Webkit-scrollbar challenge
/**
* The -Webkit-scrollbar challenge
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Make the first div’s scrollbar like the second’s
* without changing the styling of the div (i.e. you
* can only change the ::-webkit-scrollbar-* rules
* * * * * * * * * * * * * * * * * * * * * * * * * * * *
* It doesn't matter if the second div doesn't look the same
* after your changes, it's only there to show you how the
* end result should look.
@LeaVerou
LeaVerou / dabblet.css
Created January 4, 2012 16:09
Lined paper that follows the text
/**
* Lined paper that follows the text
* Support: Chrome, FF 3.6+, Saf 5.1+, Opera 11.50+, IE10
*/
/* Just decorative */
padding: 20px;
/* The font. Try changing font-size and see how the lines
@LeaVerou
LeaVerou / dabblet.css
Created January 4, 2012 16:42
Webkit bug reduction
/**
* Webkit bug reduction
* Bug originally spotted in http://dabblet.com/gist/1560717
*/
/* The font. Try changing font-size and see how the lines
still follow the text
In Webkit, certain numbers */
@LeaVerou
LeaVerou / dabblet.css
Created January 4, 2012 18:30 — forked from anonymous/dabblet.css
WebKit bug?
/* WebKit bug? */
a {
-moz-transition: border-color 1s;
-ms-transition: border-color 1s;
-o-transition: border-color 1s;
-webkit-transition: 1s background;
display: block;
height: 100px;
@LeaVerou
LeaVerou / dabblet.css
Created January 4, 2012 22:55
box-shadow vs drop-shadow
/**
* box-shadow vs drop-shadow
* Webkit-only at the moment (Chrome Canary or Webkit nightlies)
*/
div {
position: relative;
width: 150px;
padding: 20px;
border: 5px dotted;
@LeaVerou
LeaVerou / dabblet.css
Created January 4, 2012 23:03
box-shadow vs drop-shadow
/**
* box-shadow vs drop-shadow
* Webkit-only at the moment (Chrome Canary or Webkit nightlies)
*/
div {
position: relative;
width: 150px;
padding: 20px;
border: 5px dotted;
@LeaVerou
LeaVerou / dabblet.css
Created January 4, 2012 23:30
grayscale() and saturate() filters demo
/**
* grayscale() and saturate() filters demo
* Webkit-only at the moment (Chrome Canary or Webkit nightlies)
*/
img {
transition: .5s -webkit-filter;
}
img:first-of-type {