From cf81c46c770bc5cabd13b0b0d23c7db14c7f572e Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Mon, 1 Jul 2013 14:13:26 -0400 Subject: [PATCH] Omit fonts.css on QtWebKit clients QTBUG-3467 prevents non-normal-face @font-face fonts from being used when defined as such in CSS. To work around this, the desktop applications now ship the Humbug font themselves, and this commit causes the server to no longer send the problematic CSS rules to those clients. We have some duplication insofar as we now have two minified CSS files, but this is better than conditionally applying the CSS at page runtime. (imported from commit 9a887f9fb8002d44171d366d1249ebbf21cc9c77) --- humbug/settings.py | 13 + templates/zephyr/index.html | 5 + zephyr/static/styles/fonts.css | 336 ---------------------- zephyr/static/styles/thirdparty-fonts.css | 336 ++++++++++++++++++++++ zephyr/views.py | 10 + 5 files changed, 364 insertions(+), 336 deletions(-) create mode 100644 zephyr/static/styles/thirdparty-fonts.css diff --git a/humbug/settings.py b/humbug/settings.py index b79e663229..7bb1d6f616 100644 --- a/humbug/settings.py +++ b/humbug/settings.py @@ -257,12 +257,25 @@ PIPELINE_CSS = { ), 'output_filename': 'min/portico.css' }, + # Two versions of the app CSS exist because of QTBUG-3467 + 'app-fontcompat': { + 'source_filenames': ( + 'third/bootstrap-notify/css/bootstrap-notify.css', + 'third/spectrum/spectrum.css', + 'styles/zephyr.css', + 'styles/pygments.css', + 'styles/thirdparty-fonts.css', + # We don't want fonts.css on QtWebKit, so its omitted here + ), + 'output_filename': 'min/app-fontcompat.css' + }, 'app': { 'source_filenames': ( 'third/bootstrap-notify/css/bootstrap-notify.css', 'third/spectrum/spectrum.css', 'styles/zephyr.css', 'styles/pygments.css', + 'styles/thirdparty-fonts.css', 'styles/fonts.css', ), 'output_filename': 'min/app.css' diff --git a/templates/zephyr/index.html b/templates/zephyr/index.html index d590354151..eb9ed5e8d7 100644 --- a/templates/zephyr/index.html +++ b/templates/zephyr/index.html @@ -17,7 +17,12 @@ var page_params = {{ page_params }}; {% block customhead %} +{% if nofontface %} +{# We can't use @font-face on qtwebkit, so use differently minified CSS #} +{% compressed_css 'app-fontcompat' %} +{% else %} {% compressed_css 'app' %} +{% endif %} {% compressed_js 'app' %} {% if debug %} diff --git a/zephyr/static/styles/fonts.css b/zephyr/static/styles/fonts.css index 3951835cad..783cff01d8 100644 --- a/zephyr/static/styles/fonts.css +++ b/zephyr/static/styles/fonts.css @@ -1,40 +1,3 @@ -/*! - Software from "Font Awesome 3.0.2" CSS is Copyright (c) 2012-2013 Dave Gandy - and is provided under the following license: - -- - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -- -*/ - -/* - * Portions of this file are under the following license: - * - * Font Awesome 3.0.2 License - * ------------------------------------------------------- - * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL - * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - - * http://opensource.org/licenses/mit-license.html - * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ - * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: - * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" - */ - @font-face { font-family: 'Humbug'; src: url('../third/sourcesans/SourceSansPro-ExtraLight-webfont.eot'); @@ -179,302 +142,3 @@ } - - -@font-face { - font-family: 'FontAwesome'; - src: url('../third/fontawesome/fontawesome3-webfont.eot?v=3.0.1'); - src: url('../third/fontawesome/fontawesome3-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'), - url('../third/fontawesome/fontawesome3-webfont.woff?v=3.0.1') format('woff'), - url('../third/fontawesome/fontawesome3-webfont.ttf?v=3.0.1') format('truetype'), - url('../third/fontawesome/fontawesome3-webfont.svg#FontAwesome') format('svg'); - font-weight: normal; - font-style: normal; -} - -/* Font Awesome styles - ------------------------------------------------------- */ -[class^="icon-vector-"], -[class*=" icon-vector-"] { - font-family: FontAwesome; - font-weight: normal; - font-style: normal; - text-decoration: inherit; - -webkit-font-smoothing: antialiased; - - /* sprites.less reset */ - display: inline; - width: auto; - height: auto; - line-height: normal; - vertical-align: baseline; - background-image: none; - background-position: 0% 0%; - background-repeat: repeat; - margin-top: 0; -} -/* more sprites.less reset */ -.icon-vector-white, -.nav-pills > .active > a > [class^="icon-vector-"], -.nav-pills > .active > a > [class*=" icon-vector-"], -.nav-list > .active > a > [class^="icon-vector-"], -.nav-list > .active > a > [class*=" icon-vector-"], -.navbar-inverse .nav > .active > a > [class^="icon-vector-"], -.navbar-inverse .nav > .active > a > [class*=" icon-vector-"], -.dropdown-menu > li > a:hover > [class^="icon-vector-"], -.dropdown-menu > li > a:hover > [class*=" icon-vector-"], -.dropdown-menu > .active > a > [class^="icon-vector-"], -.dropdown-menu > .active > a > [class*=" icon-vector-"], -.dropdown-submenu:hover > a > [class^="icon-vector-"], -.dropdown-submenu:hover > a > [class*=" icon-vector-"] { - background-image: none; -} -[class^="icon-vector-"]:before, -[class*=" icon-vector-"]:before { - text-decoration: inherit; - display: inline-block; - speak: none; -} -/* makes sure icons active on rollover in links */ -a [class^="icon-vector-"], -a [class*=" icon-vector-"] { - display: inline-block; -} -/* makes the font 33% larger relative to the icon container */ -.icon-vector-large:before { - vertical-align: -10%; - font-size: 1.3333333333333333em; -} -.btn [class^="icon-vector-"], -.nav [class^="icon-vector-"], -.btn [class*=" icon-vector-"], -.nav [class*=" icon-vector-"] { - display: inline; - /* keeps button heights with and without icons the same */ - -} -.btn [class^="icon-vector-"].icon-vector-large, -.nav [class^="icon-vector-"].icon-vector-large, -.btn [class*=" icon-vector-"].icon-vector-large, -.nav [class*=" icon-vector-"].icon-vector-large { - line-height: .9em; -} -.btn [class^="icon-vector-"].icon-vector-spin, -.nav [class^="icon-vector-"].icon-vector-spin, -.btn [class*=" icon-vector-"].icon-vector-spin, -.nav [class*=" icon-vector-"].icon-vector-spin { - display: inline-block; -} -.nav-tabs [class^="icon-vector-"], -.nav-pills [class^="icon-vector-"], -.nav-tabs [class*=" icon-vector-"], -.nav-pills [class*=" icon-vector-"] { - /* keeps button heights with and without icons the same */ - -} -.nav-tabs [class^="icon-vector-"], -.nav-pills [class^="icon-vector-"], -.nav-tabs [class*=" icon-vector-"], -.nav-pills [class*=" icon-vector-"], -.nav-tabs [class^="icon-vector-"].icon-vector-large, -.nav-pills [class^="icon-vector-"].icon-vector-large, -.nav-tabs [class*=" icon-vector-"].icon-vector-large, -.nav-pills [class*=" icon-vector-"].icon-vector-large { - line-height: .9em; -} -li [class^="icon-vector-"], -.nav li [class^="icon-vector-"], -li [class*=" icon-vector-"], -.nav li [class*=" icon-vector-"] { - display: inline-block; - width: 1.25em; - text-align: center; -} -li [class^="icon-vector-"].icon-vector-large, -.nav li [class^="icon-vector-"].icon-vector-large, -li [class*=" icon-vector-"].icon-vector-large, -.nav li [class*=" icon-vector-"].icon-vector-large { - /* increased font size for icon-vector-large */ - - width: 1.5625em; -} -ul.icons { - list-style-type: none; - text-indent: -0.75em; -} -ul.icons li [class^="icon-vector-"], -ul.icons li [class*=" icon-vector-"] { - width: .75em; -} -.icon-vector-muted { - color: #eeeeee; -} -.icon-vector-border { - border: solid 1px #eeeeee; - padding: .2em .25em .15em; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} -.icon-vector-small { - font-size: 0.8em; -} -.icon-vector-2x { - font-size: 2em; -} -.icon-vector-2x.icon-vector-border { - border-width: 2px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} -.icon-vector-3x { - font-size: 3em; -} -.icon-vector-3x.icon-vector-border { - border-width: 3px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.icon-vector-4x { - font-size: 4em; -} -.icon-vector-4x.icon-vector-border { - border-width: 4px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} -.pull-right { - float: right; -} -.pull-left { - float: left; -} -[class^="icon-vector-"].pull-left, -[class*=" icon-vector-"].pull-left { - margin-right: .3em; -} -[class^="icon-vector-"].pull-right, -[class*=" icon-vector-"].pull-right { - margin-left: .3em; -} -.btn [class^="icon-vector-"].pull-left.icon-vector-2x, -.btn [class*=" icon-vector-"].pull-left.icon-vector-2x, -.btn [class^="icon-vector-"].pull-right.icon-vector-2x, -.btn [class*=" icon-vector-"].pull-right.icon-vector-2x { - margin-top: .18em; -} -.btn [class^="icon-vector-"].icon-vector-spin.icon-vector-large, -.btn [class*=" icon-vector-"].icon-vector-spin.icon-vector-large { - line-height: .8em; -} -.btn.btn-small [class^="icon-vector-"].pull-left.icon-vector-2x, -.btn.btn-small [class*=" icon-vector-"].pull-left.icon-vector-2x, -.btn.btn-small [class^="icon-vector-"].pull-right.icon-vector-2x, -.btn.btn-small [class*=" icon-vector-"].pull-right.icon-vector-2x { - margin-top: .25em; -} -.btn.btn-large [class^="icon-vector-"], -.btn.btn-large [class*=" icon-vector-"] { - margin-top: 0; -} -.btn.btn-large [class^="icon-vector-"].pull-left.icon-vector-2x, -.btn.btn-large [class*=" icon-vector-"].pull-left.icon-vector-2x, -.btn.btn-large [class^="icon-vector-"].pull-right.icon-vector-2x, -.btn.btn-large [class*=" icon-vector-"].pull-right.icon-vector-2x { - margin-top: .05em; -} -.btn.btn-large [class^="icon-vector-"].pull-left.icon-vector-2x, -.btn.btn-large [class*=" icon-vector-"].pull-left.icon-vector-2x { - margin-right: .2em; -} -.btn.btn-large [class^="icon-vector-"].pull-right.icon-vector-2x, -.btn.btn-large [class*=" icon-vector-"].pull-right.icon-vector-2x { - margin-left: .2em; -} -.icon-vector-spin { - display: inline-block; - -moz-animation: spin 2s infinite linear; - -o-animation: spin 2s infinite linear; - -webkit-animation: spin 2s infinite linear; - animation: spin 2s infinite linear; -} -@-moz-keyframes spin { - 0% { -moz-transform: rotate(0deg); } - 100% { -moz-transform: rotate(359deg); } -} -@-webkit-keyframes spin { - 0% { -webkit-transform: rotate(0deg); } - 100% { -webkit-transform: rotate(359deg); } -} -@-o-keyframes spin { - 0% { -o-transform: rotate(0deg); } - 100% { -o-transform: rotate(359deg); } -} -@-ms-keyframes spin { - 0% { -ms-transform: rotate(0deg); } - 100% { -ms-transform: rotate(359deg); } -} -@keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(359deg); } -} -@-moz-document url-prefix() { - .icon-vector-spin { - height: .9em; - } - .btn .icon-vector-spin { - height: auto; - } - .icon-vector-spin.icon-vector-large { - height: 1.25em; - } - .btn .icon-vector-spin.icon-vector-large { - height: .75em; - } -} -/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen - readers do not read off random characters that represent icons */ -.icon-vector-star:before { content: "\f005"; } -.icon-vector-star-empty:before { content: "\f006"; } -.icon-vector-paper-clip:before { content: "\f0c6"; } -.icon-vector-random:before { content: "\f074"; } -.icon-vector-desktop:before { content: "\f108"; } -.icon-vector-mobile-phone:before { content: "\f10b"; } -.icon-vector-lock:before { content: "\f023"; } -.icon-vector-bell:before { content: "\f0a2"; } -.icon-vector-comments:before { content: "\f086"; } -.icon-vector-quote-left:before { content: "\f10d"; } -.icon-vector-road:before { content: "\f018"; } -.icon-vector-search:before { content: "\f002"; } -.icon-vector-picture:before { content: "\f03e"; } -.icon-vector-home:before { content: "\f015"; } -.icon-vector-group:before { content: "\f0c0"; } -.icon-vector-info-sign:before { content: "\f05a"; } -.icon-vector-user:before { content: "\f007"; } -.icon-vector-font:before { content: "\f031"; } -.icon-vector-thumbs-up:before { content: "\f087"; } -.icon-vector-github:before { content: "\f09b"; } -.icon-vector-sitemap:before { content: "\f0e8"; } -.icon-vector-edit:before { content: "\f044"; } -.icon-vector-bullhorn:before { content: "\f0a1"; } -.icon-vector-list:before { content: "\f03a"; } -.icon-vector-cog:before { content: "\f013"; } -.icon-vector-check:before { content: "\f046"; } -.icon-vector-check-empty:before { content: "\f096"; } -.icon-vector-comment:before { content: "\f075"; } -.icon-vector-narrow:before { content: "\f054"; } -.icon-vector-minus-sign:before { content: "\f056"; } -.icon-vector-plus-sign:before { content: "\f055"; } -.icon-vector-pencil:before { content: "\f040"; } -.icon-vector-eraser:before { content: "\f12d"; } -.icon-vector-envelope:before { content: "\f003"; } -.icon-vector-tag:before { content: "\f02b"; } -.icon-vector-question-sign:before { content: "\f059"; } -.icon-vector-remove:before { content: "\f00d"; } -.icon-vector-angle-down:before { content: "\f107"; } -.icon-vector-chevron-up:before { content: "\f077"; } -.icon-vector-chevron-down:before { content: "\f078"; } -.icon-vector-caret-right:before { content: "\f0da"; } diff --git a/zephyr/static/styles/thirdparty-fonts.css b/zephyr/static/styles/thirdparty-fonts.css new file mode 100644 index 0000000000..2ec4d092f5 --- /dev/null +++ b/zephyr/static/styles/thirdparty-fonts.css @@ -0,0 +1,336 @@ +/*! + Software from "Font Awesome 3.0.2" CSS is Copyright (c) 2012-2013 Dave Gandy + and is provided under the following license: + -- + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + -- +*/ + +/* + * Portions of this file are under the following license: + * + * Font Awesome 3.0.2 License + * ------------------------------------------------------- + * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - + * http://opensource.org/licenses/mit-license.html + * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" + */ + + + +@font-face { + font-family: 'FontAwesome'; + src: url('../third/fontawesome/fontawesome3-webfont.eot?v=3.0.1'); + src: url('../third/fontawesome/fontawesome3-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'), + url('../third/fontawesome/fontawesome3-webfont.woff?v=3.0.1') format('woff'), + url('../third/fontawesome/fontawesome3-webfont.ttf?v=3.0.1') format('truetype'), + url('../third/fontawesome/fontawesome3-webfont.svg#FontAwesome') format('svg'); + font-weight: normal; + font-style: normal; +} + +/* Font Awesome styles + ------------------------------------------------------- */ +[class^="icon-vector-"], +[class*=" icon-vector-"] { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + text-decoration: inherit; + -webkit-font-smoothing: antialiased; + + /* sprites.less reset */ + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none; + background-position: 0% 0%; + background-repeat: repeat; + margin-top: 0; +} +/* more sprites.less reset */ +.icon-vector-white, +.nav-pills > .active > a > [class^="icon-vector-"], +.nav-pills > .active > a > [class*=" icon-vector-"], +.nav-list > .active > a > [class^="icon-vector-"], +.nav-list > .active > a > [class*=" icon-vector-"], +.navbar-inverse .nav > .active > a > [class^="icon-vector-"], +.navbar-inverse .nav > .active > a > [class*=" icon-vector-"], +.dropdown-menu > li > a:hover > [class^="icon-vector-"], +.dropdown-menu > li > a:hover > [class*=" icon-vector-"], +.dropdown-menu > .active > a > [class^="icon-vector-"], +.dropdown-menu > .active > a > [class*=" icon-vector-"], +.dropdown-submenu:hover > a > [class^="icon-vector-"], +.dropdown-submenu:hover > a > [class*=" icon-vector-"] { + background-image: none; +} +[class^="icon-vector-"]:before, +[class*=" icon-vector-"]:before { + text-decoration: inherit; + display: inline-block; + speak: none; +} +/* makes sure icons active on rollover in links */ +a [class^="icon-vector-"], +a [class*=" icon-vector-"] { + display: inline-block; +} +/* makes the font 33% larger relative to the icon container */ +.icon-vector-large:before { + vertical-align: -10%; + font-size: 1.3333333333333333em; +} +.btn [class^="icon-vector-"], +.nav [class^="icon-vector-"], +.btn [class*=" icon-vector-"], +.nav [class*=" icon-vector-"] { + display: inline; + /* keeps button heights with and without icons the same */ + +} +.btn [class^="icon-vector-"].icon-vector-large, +.nav [class^="icon-vector-"].icon-vector-large, +.btn [class*=" icon-vector-"].icon-vector-large, +.nav [class*=" icon-vector-"].icon-vector-large { + line-height: .9em; +} +.btn [class^="icon-vector-"].icon-vector-spin, +.nav [class^="icon-vector-"].icon-vector-spin, +.btn [class*=" icon-vector-"].icon-vector-spin, +.nav [class*=" icon-vector-"].icon-vector-spin { + display: inline-block; +} +.nav-tabs [class^="icon-vector-"], +.nav-pills [class^="icon-vector-"], +.nav-tabs [class*=" icon-vector-"], +.nav-pills [class*=" icon-vector-"] { + /* keeps button heights with and without icons the same */ + +} +.nav-tabs [class^="icon-vector-"], +.nav-pills [class^="icon-vector-"], +.nav-tabs [class*=" icon-vector-"], +.nav-pills [class*=" icon-vector-"], +.nav-tabs [class^="icon-vector-"].icon-vector-large, +.nav-pills [class^="icon-vector-"].icon-vector-large, +.nav-tabs [class*=" icon-vector-"].icon-vector-large, +.nav-pills [class*=" icon-vector-"].icon-vector-large { + line-height: .9em; +} +li [class^="icon-vector-"], +.nav li [class^="icon-vector-"], +li [class*=" icon-vector-"], +.nav li [class*=" icon-vector-"] { + display: inline-block; + width: 1.25em; + text-align: center; +} +li [class^="icon-vector-"].icon-vector-large, +.nav li [class^="icon-vector-"].icon-vector-large, +li [class*=" icon-vector-"].icon-vector-large, +.nav li [class*=" icon-vector-"].icon-vector-large { + /* increased font size for icon-vector-large */ + + width: 1.5625em; +} +ul.icons { + list-style-type: none; + text-indent: -0.75em; +} +ul.icons li [class^="icon-vector-"], +ul.icons li [class*=" icon-vector-"] { + width: .75em; +} +.icon-vector-muted { + color: #eeeeee; +} +.icon-vector-border { + border: solid 1px #eeeeee; + padding: .2em .25em .15em; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.icon-vector-small { + font-size: 0.8em; +} +.icon-vector-2x { + font-size: 2em; +} +.icon-vector-2x.icon-vector-border { + border-width: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.icon-vector-3x { + font-size: 3em; +} +.icon-vector-3x.icon-vector-border { + border-width: 3px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.icon-vector-4x { + font-size: 4em; +} +.icon-vector-4x.icon-vector-border { + border-width: 4px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +[class^="icon-vector-"].pull-left, +[class*=" icon-vector-"].pull-left { + margin-right: .3em; +} +[class^="icon-vector-"].pull-right, +[class*=" icon-vector-"].pull-right { + margin-left: .3em; +} +.btn [class^="icon-vector-"].pull-left.icon-vector-2x, +.btn [class*=" icon-vector-"].pull-left.icon-vector-2x, +.btn [class^="icon-vector-"].pull-right.icon-vector-2x, +.btn [class*=" icon-vector-"].pull-right.icon-vector-2x { + margin-top: .18em; +} +.btn [class^="icon-vector-"].icon-vector-spin.icon-vector-large, +.btn [class*=" icon-vector-"].icon-vector-spin.icon-vector-large { + line-height: .8em; +} +.btn.btn-small [class^="icon-vector-"].pull-left.icon-vector-2x, +.btn.btn-small [class*=" icon-vector-"].pull-left.icon-vector-2x, +.btn.btn-small [class^="icon-vector-"].pull-right.icon-vector-2x, +.btn.btn-small [class*=" icon-vector-"].pull-right.icon-vector-2x { + margin-top: .25em; +} +.btn.btn-large [class^="icon-vector-"], +.btn.btn-large [class*=" icon-vector-"] { + margin-top: 0; +} +.btn.btn-large [class^="icon-vector-"].pull-left.icon-vector-2x, +.btn.btn-large [class*=" icon-vector-"].pull-left.icon-vector-2x, +.btn.btn-large [class^="icon-vector-"].pull-right.icon-vector-2x, +.btn.btn-large [class*=" icon-vector-"].pull-right.icon-vector-2x { + margin-top: .05em; +} +.btn.btn-large [class^="icon-vector-"].pull-left.icon-vector-2x, +.btn.btn-large [class*=" icon-vector-"].pull-left.icon-vector-2x { + margin-right: .2em; +} +.btn.btn-large [class^="icon-vector-"].pull-right.icon-vector-2x, +.btn.btn-large [class*=" icon-vector-"].pull-right.icon-vector-2x { + margin-left: .2em; +} +.icon-vector-spin { + display: inline-block; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} +@-moz-keyframes spin { + 0% { -moz-transform: rotate(0deg); } + 100% { -moz-transform: rotate(359deg); } +} +@-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(359deg); } +} +@-o-keyframes spin { + 0% { -o-transform: rotate(0deg); } + 100% { -o-transform: rotate(359deg); } +} +@-ms-keyframes spin { + 0% { -ms-transform: rotate(0deg); } + 100% { -ms-transform: rotate(359deg); } +} +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(359deg); } +} +@-moz-document url-prefix() { + .icon-vector-spin { + height: .9em; + } + .btn .icon-vector-spin { + height: auto; + } + .icon-vector-spin.icon-vector-large { + height: 1.25em; + } + .btn .icon-vector-spin.icon-vector-large { + height: .75em; + } +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-vector-star:before { content: "\f005"; } +.icon-vector-star-empty:before { content: "\f006"; } +.icon-vector-paper-clip:before { content: "\f0c6"; } +.icon-vector-random:before { content: "\f074"; } +.icon-vector-desktop:before { content: "\f108"; } +.icon-vector-mobile-phone:before { content: "\f10b"; } +.icon-vector-lock:before { content: "\f023"; } +.icon-vector-bell:before { content: "\f0a2"; } +.icon-vector-comments:before { content: "\f086"; } +.icon-vector-quote-left:before { content: "\f10d"; } +.icon-vector-road:before { content: "\f018"; } +.icon-vector-search:before { content: "\f002"; } +.icon-vector-picture:before { content: "\f03e"; } +.icon-vector-home:before { content: "\f015"; } +.icon-vector-group:before { content: "\f0c0"; } +.icon-vector-info-sign:before { content: "\f05a"; } +.icon-vector-user:before { content: "\f007"; } +.icon-vector-font:before { content: "\f031"; } +.icon-vector-thumbs-up:before { content: "\f087"; } +.icon-vector-github:before { content: "\f09b"; } +.icon-vector-sitemap:before { content: "\f0e8"; } +.icon-vector-edit:before { content: "\f044"; } +.icon-vector-bullhorn:before { content: "\f0a1"; } +.icon-vector-list:before { content: "\f03a"; } +.icon-vector-cog:before { content: "\f013"; } +.icon-vector-check:before { content: "\f046"; } +.icon-vector-check-empty:before { content: "\f096"; } +.icon-vector-comment:before { content: "\f075"; } +.icon-vector-narrow:before { content: "\f054"; } +.icon-vector-minus-sign:before { content: "\f056"; } +.icon-vector-plus-sign:before { content: "\f055"; } +.icon-vector-pencil:before { content: "\f040"; } +.icon-vector-eraser:before { content: "\f12d"; } +.icon-vector-envelope:before { content: "\f003"; } +.icon-vector-tag:before { content: "\f02b"; } +.icon-vector-question-sign:before { content: "\f059"; } +.icon-vector-remove:before { content: "\f00d"; } +.icon-vector-angle-down:before { content: "\f107"; } +.icon-vector-chevron-up:before { content: "\f077"; } +.icon-vector-chevron-down:before { content: "\f078"; } +.icon-vector-caret-right:before { content: "\f0da"; } diff --git a/zephyr/views.py b/zephyr/views.py index 3d85c8fc8b..d530af8192 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -579,12 +579,22 @@ def home(request): {'user_profile': user_profile, 'page_params' : page_params, 'avatar_url': avatar_url(user_profile), + 'nofontface': is_buggy_ua(request.META["HTTP_USER_AGENT"]), 'show_debug': settings.DEBUG and ('show_debug' in request.GET), 'show_invites': show_invites }, context_instance=RequestContext(request)) +def is_buggy_ua(agent): + """Discrimiate CSS served to clients based on User Agent + + Due to QTBUG-3467, @font-face is not supported in QtWebKit. + This may get fixed in the future, but for right now we can + just serve the more conservative CSS to all our desktop apps. + """ + return "Humbug Desktop/" in agent + def get_pointer_backend(request, user_profile): return json_success({'pointer': user_profile.pointer})