From d177336f4b973f83eacff58f41b751e356e4c5fa Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 28 Jul 2014 21:48:36 -0400 Subject: [PATCH] conditional css chrome --- .../2014/2014-03-13-conditional-css-chrome.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 _posts/2014/2014-03-13-conditional-css-chrome.md diff --git a/_posts/2014/2014-03-13-conditional-css-chrome.md b/_posts/2014/2014-03-13-conditional-css-chrome.md new file mode 100644 index 0000000..079c129 --- /dev/null +++ b/_posts/2014/2014-03-13-conditional-css-chrome.md @@ -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).