Skip to content

Instantly share code, notes, and snippets.

@frangio
Created April 12, 2012 19:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save frangio/2370273 to your computer and use it in GitHub Desktop.
Save frangio/2370273 to your computer and use it in GitHub Desktop.
Ruby Polyfill
/* Simplified version of http://www.useragentman.com/blog/2010/10/29/cross-browser-html5-ruby-annotations-using-css/
for use with Modernizr.load() */
ruby {
display: inline-table;
text-align: center;
border-collapse: collapse;
border: none;
vertical-align: middle;
border-bottom: solid 0.75em transparent;
}
ruby > rt,
rtc {
display: table-header-group;
}
ruby > rb,
rbc,
ruby > rt + rt,
rtc + rtc {
display: table-row;
}
ruby > rt + rt,
rtc + rtc {
border-bottom: hidden;
}
rb,
rbc,
rt,
rtc {
white-space: nowrap;
}
rtc > rt,
rbc > rb {
display: table-cell;
}
rtc > rt[rbspan] {
column-span: attr(rbspan);
}
ruby > rt,
rtc {
font-size: 0.5em;
line-height: 1.2em;
}
rp {
display: none;
}
ruby {
ruby-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment