Skip to content

Commit 867961f

Browse files
committed
Fix the text-flicker-on-hover Safari issue
and, in doing so, justify a directory of shameful CSS rules.
1 parent fc698ef commit 867961f

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

dynamic/css/main.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@
4545
'pages/index',
4646
'pages/developing/getting-started',
4747
'pages/learning/use-cases';
48+
49+
// 7. Styles so shameful they get their own directory
50+
@import
51+
'shame/safari-text-flicker-fix';

dynamic/css/shame/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Shame
2+
3+
If you write a rule that should not be written, a work-around for non-compliant
4+
browser behavior, a fix the standard should be fixing itself, a hack that makes
5+
you ashamed of yourself as you're writing it... That rule belongs here.
6+
7+
Hopefully the rules written here will be temporary (for some definition of
8+
"temporary"), and browsers and the CSS standard will eventually be robust enough
9+
that we don't need to be ashamed of ourselves. Until then, we should sequester
10+
the worst of our rules somewhere s.t. we know what should be fixed first.
11+
12+
This is not part of the 7-1 architecture, and so has no reference.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* An issue was observed in Safari where hovering over sub-headings -- which
3+
* would case a doc icon's opacity to transition from 0 to 1 -- was causing all
4+
* of the text in the main article to flicker. More specifically, it was losing,
5+
* and then regaining a certain amount of clarity.
6+
*
7+
* It turns this was caused by Safari changing the entire element from a 2D
8+
* object to a 3D object for the duration of the transition.
9+
*
10+
* This rule sets the entire element to a 3D object _at load time_ to prevent
11+
* the change from occurring. How stupid is that?
12+
*
13+
* Fix found on http://stackoverflow.com/questions/30637358
14+
*/
15+
.main-article {
16+
-webkit-transform: translate3d(0, 0, 0);
17+
}

0 commit comments

Comments
 (0)