Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
|
||
title: Conditional CSS doesn’t work in Chrome | ||
tags: [ canvas ] | ||
|
||
layout: default | ||
|
||
id: '79494424279' | ||
--- | ||
|
||
[Jeremy Keith's Conditional CSS technique](http://adactio.com/journal/5429) currently doesn't work in Chrome. | ||
|
||
@media all and (min-width: 45em) { | ||
body:after { | ||
content: 'widescreen'; | ||
display: none; | ||
} | ||
} | ||
|
||
The problem is with how [Chrome will not generate pseudo elements](https://code.google.com/p/chromium/issues/detail?id=236603) when set to `display: none`. | ||
|
||
My current solution/hack is to fallback to the `head font-size` code, as Opera now supports this. | ||
|
||
@media screen and (min-width: 45em) { | ||
head { | ||
font-family: widescreen; | ||
} | ||
} | ||
|
||
Thx [@overflowhidden for the assist](https://twitter.com/overflowhidden/status/444020047552712704). |