ga “Mobile first” CSS and getting Sass to help with legacy IE By nicolasgallagher.com Published On :: Mon, 28 Nov 2011 16:00:00 -0800 Taking a “mobile first” approach to web development poses some challenges if you need to provide a “desktop” experience for legacy versions of IE. Using a CSS pre-processor like Sass can help. As of Sass 3.2, there is another way of catering for IE, described by Jake Archibald. One aspect of a “mobile first” approach to development is that your styles are usually gradually built up from a simple base. Each new “layer” of CSS adds presentational adjustments and complexity, via CSS3 Media Queries, to react to and make use of additional viewport space. However, IE 6/7/8 do not support CSS3 Media Queries. If you want to serve IE 6/7/8 something more than just the base CSS, then you need a solution that exposes the “enhancing” CSS to those browsers. Popular existing options An existing option is the use of a CSS3 Media Query polyfill, such as Respond.js. However, there are some drawbacks to this approach (see the project README), such as the introduction of a JavaScript dependency and the XHRing of your style sheets, which may introduce performance or cross-domain security issues. Furthermore, adding support for CSS3 Media Queries is probably not necessary for these legacy browsers. The main concern is exposing the “enhancing” CSS. Another method, which Jeremy Keith has described in his post on Windows mobile media queries, is to use separate CSS files: one basic global file, and an “enhancing” file that is referenced twice in the <head> of the document. The “enhancing” file is referenced once using a media attribute containing a CSS3 Media Query value. This prevents it being downloaded by browsers (such as IE 6/7/8) which do not support CSS3 Media Queries. The same file is then referenced again, this time wrapped in an IE conditional comment (without the use of a CSS3 Media Query value) to hide it from modern browsers. However, this approach becomes somewhat cumbersome, and introduces multiple HTTP requests, if you have multiple breakpoints in your responsive design. Getting Sass to help Sass 3.1 provides some features that help make this second approach more flexible. The general advantages of the Sass-based approach I’ve used are: You have full control over how your style sheets are broken up and reassembled. It removes the performance concerns of having to reference several separate style sheets for each breakpoint in the responsive design, simply to cater for IE 6/7/8. You can easily repeat large chunks of CSS in separate compiled files without introducing maintenance problems. The basic idea is to produce two versions of your compiled CSS from the same core code. One version of your CSS includes CSS3 @media queries and is downloaded by modern browsers. The other version is only downloaded by IE 6/7/8 in a desktop environment and contains no CSS3 @media queries. To do this, you take advantage of the fact that Sass can import and compile separate .scss/.sass files into a single CSS file. This allows you to keep the CSS rules used at any breakpoint completely separate from the @media query that you might want it to be a part of. This is not a CSS3 Media Query polyfill, so one assumption is that IE 6/7/8 users will predominantly be using mid-size screens and should receive styles appropriate to that environment. Therefore, in the example below, I am making a subjective judgement by including all the breakpoint styles up to a width of 960px but withholding those for any breakpoints beyond that. The ie.scss file imports numerous other files, each containing a layer of CSS that builds upon the previous each layer of CSS. No CSS3 @media queries are contained within the files or the ie.scss file. It then compiles to a single CSS file that is designed to be served only to IE 6/7/8. // ie.scss @import "base"; @import "320-up"; @import "480-up"; @import "780-up"; @import "960-up"; The style.scss file imports the code for each breakpoint involved in the design (including any beyond the limit imposed for legacy versions of IE) but nests them within the relevant CSS3 @media query. The compiled version of this file is served to all browsers apart from IE 6/7/8 and IEMobile. // style.scss @import "base"; @media (min-width:320px) { @import "320-up"; } @media (min-width:480px) { @import "480-up"; } @media (min-width:780px) { @import "780-up"; } @media (min-width:960px) { @import "960-up"; } @media (min-width:1100px) { @import "1100-up"; } The resulting CSS files can then be referenced in the HTML. It is important to hide the ie.css file from any IE-based mobile browsers. This ensures that they do not download the CSS meant for desktop versions of IE. <!--[if (gt IE 8) | (IEMobile)]><!--> <link rel="stylesheet" href="/css/style.css"> <!--<![endif]--> <!--[if (lt IE 9) & (!IEMobile)]> <link rel="stylesheet" href="/css/ie.css"> <![endif]--> This Sass-enabled approach works just as well if you need to serve a basic style sheet for mobiles without CSS3 Media Query support, and prevent those devices from downloading the CSS used to adapt the layout to wider viewports. For example, you can avoid importing base.scss into the ie.scss and style.scss files. It can then be referenced separately in the HTML. <link rel="stylesheet" href="/css/base.css"> <link rel="stylesheet" href="/css/style.css" media="(min-width:320px)"> <!--[if (lt IE 9) & (!IEMobile)]> <link rel="stylesheet" href="/css/ie.css"> <![endif]--> You’ll notice that I didn’t wrap the style.css reference in a conditional comment to hide it from legacy versions of IE. It’s not necessary this time because the value of the media attribute is not understood by legacy versions of IE, and the style sheet will not be downloaded. In different circumstances, different combinations of style sheets and media attribute values will be more appropriate. Summary Even if you want to don’t want to use any of the Sass or SCSS syntax, the pre-processor itself can help you to write your CSS in a “mobile first” manner (with multiple breakpoints), provide a “desktop” experience for IE 6/7/8, and avoid some of the performance or maintenance concerns that are sometimes present when juggling the two requirements. I’m relatively new to using Sass, so there may be even better ways to achieve the same result or even to prevent the inclusion of IE-specific CSS unless the file is being compiled into a style sheet that only IE will download. Full Article
ga Crime Branch busts cigarette, tobacco smuggling racket By www.thehindu.com Published On :: Sat, 09 May 2020 02:16:50 +0530 Material brought illegally in vehicles that had permission to carry fruits and vegetables Full Article Other States
ga Coronavirus | Nine deaths, 130 cases reported in Bengal By www.thehindu.com Published On :: Sat, 09 May 2020 02:05:54 +0530 This has been the highest spike in the number of cases in the State in a single day, taking the number of cases to 1,678 Full Article Other States
ga International experts to be consulted on Styrene gas leak at Visakhapatnam By www.thehindu.com Published On :: Sat, 09 May 2020 02:20:17 +0530 The NCMC chaired by Cabinet Secretary Rajiv Gauba met on Friday to review the situation arising out of the gas leak Full Article Other States
ga Ganjam sparred community spread as migrants stay put at quarantine centres By www.thehindu.com Published On :: Sat, 09 May 2020 02:08:17 +0530 All returnees are taken to centres from buses and trains Full Article Other States
ga Punjab police arrest gangster Baljinder Singh By www.thehindu.com Published On :: Sat, 09 May 2020 02:46:59 +0530 He is wanted for murder, attempt to murder and smuggling of weapons and drugs Full Article Other States
ga Maximum alert against killer COVID-19 By www.assamtimes.org Published On :: Sat, 28 Mar 2020 17:22:41 +0000 Full Article
ga MASS condemn arrest of Gautam Navalakha and Anand Teltumbe By www.assamtimes.org Published On :: Thu, 16 Apr 2020 12:00:11 +0000 Full Article
ga Strategic information management [electronic resource] : challenges and strategies in managing information systems / R.D. Galliers and D.E. Leidner By prospero.murdoch.edu.au Published On :: Galliers, Robert, 1947- Full Article
ga Strategisches management und marketing [electronic resource] : markt- und wettbewerbsanalyse, strategische frühaufklärung, portfolio-management / Edgar Kreilkamp By prospero.murdoch.edu.au Published On :: Kreilkamp, Edgar Full Article
ga Systemisk projektledelse [electronic resource] / Henrik Schelde Andersen og Katrine Raae Søndergaard (red.) By prospero.murdoch.edu.au Published On :: Full Article
ga The talent equation [electronic resource] : big data lessons for navigating the skills gap and building a competitive workforce / Matt Ferguson, Lorin Hitt, Prasanna Tambe, with Ryan Hunt and Jennifer Sullivan Grasz By prospero.murdoch.edu.au Published On :: Ferguson, Matt Full Article
ga Tatort Projekt [electronic resource] : Wenn die Wahrheit das Geschäft stört / Jacqueline Irrgang By prospero.murdoch.edu.au Published On :: Irrgang, Jacqueline, 1959- author Full Article
ga Think before you engage [electronic resource] : 100 questions to ask before starting a social media marketing campaign / Dave Peck By prospero.murdoch.edu.au Published On :: Peck, Dave D Full Article
ga Thinkers 50 management [electronic resource] : cutting edge thinking to engage and motivate your employees for success / Stuart Crainer + Des Dearlove By prospero.murdoch.edu.au Published On :: Crainer, Stuart Full Article
ga Tivoli integration scenarios [electronic resource] / IBM, International Technical Support Organization By prospero.murdoch.edu.au Published On :: Full Article
ga Transforming legacy organizations [electronic resource] : turn your established business into an innovation champion to win the future / Kris Oestergaard By prospero.murdoch.edu.au Published On :: Oestergaard, Kris, 1973- author Full Article
ga Transforming public and nonprofit organizations [electronic resource] : stewardship for leading change / James Edwin Kee, Kathryn E. Newcomer By prospero.murdoch.edu.au Published On :: Kee, James Edwin Full Article
ga The trouble with HR [electronic resource] : an insider's guide to finding and keeping the best talent / Johnny C. Taylor, Jr. and Gary M. Stern By prospero.murdoch.edu.au Published On :: Taylor, Johnny C., 1968- Full Article
ga U.S. military program management [electronic resource] : lessons learned and best practices / Gregory A. Garrett, Rene G. Rendon By prospero.murdoch.edu.au Published On :: Garrett, Gregory A Full Article
ga Visual Design of GraphQL Data [electronic resource] : A Practical Introduction with Legacy Data and Neo4j / by Thomas Frisendal By prospero.murdoch.edu.au Published On :: Frisendal, Thomas. author Full Article
ga Waste to wealth - a distant dream? [electronic resource] : challenges in the waste disposal supply chain in Bangalore, India / Chuck Munson with M. Ramasubramaniam and P. Chandiran By prospero.murdoch.edu.au Published On :: Munson, Chuck, author Full Article
ga What is a high performance work organization? [electronic resource] / Bradley L. Kirkman, Kevin B. Lowe, Dianne P. Young By prospero.murdoch.edu.au Published On :: Kirkman, Bradley Lane, author Full Article
ga Winning the loser's game [electronic resource] : timeless strategies for successful investing / Charles D. Ellis By prospero.murdoch.edu.au Published On :: Ellis, Charles D Full Article
ga Winning the loser's game [electronic resource] : timeless strategies for successful investing / Charles D. Ellis By prospero.murdoch.edu.au Published On :: Ellis, Charles D., author Full Article
ga Work breakdown structures for projects, programs, and enterprises [electronic resource] / Gregory T. Haugan By prospero.murdoch.edu.au Published On :: Haugan, Gregory T., 1931- Full Article
ga Zero space [electronic resource] : moving beyond organizational limits / Frank Lekanne Deprez, Rene Tissen By prospero.murdoch.edu.au Published On :: Deprez, Frank Lekanne Full Article
ga Organisational change : development and transformation / Dianne Waddell [and three others] By prospero.murdoch.edu.au Published On :: Full Article
ga JAMA Facial Plastic Surgery : Superiorly Pediculated Superficial Musculoaponeurotic System Ligament Flap to Control the Supratip By traffic.libsyn.com Published On :: Thu, 27 Sep 2018 15:00:00 +0000 Interview with Roxana Cobo, MD, author of Superiorly Pediculated Superficial Musculoaponeurotic System Ligament Flap to Control the Supratip Full Article
ga JAMA Internal Medicine : Association of Organic Food Consumption With Cancer Risk By traffic.libsyn.com Published On :: Mon, 22 Oct 2018 15:00:00 +0000 Interview with Julia Baudry, PhD, author of Association of Frequency of Organic Food Consumption With Cancer Risk: Findings From the NutriNet-Santé Prospective Cohort Study, and Jorge E. Chavarro, MD, ScD, author of Organic Foods for Cancer Prevention—Worth the Investment? Full Article
ga JAMA Pediatrics : Sibling Recurrence Risk and Cross-aggregation of ADHD and Autism Spectrum Disorder By traffic.libsyn.com Published On :: Mon, 10 Dec 2018 16:00:00 +0000 Interview with Meghan Miller, PhD, author of Sibling Recurrence Risk and Cross-aggregation of Attention-Deficit/Hyperactivity Disorder and Autism Spectrum Disorder Full Article
ga JAMA Internal Medicine : A Clinical Overview of Off-label Use of Gabapentinoid Drugs By traffic.libsyn.com Published On :: Mon, 25 Mar 2019 15:00:00 +0000 Interview with Christopher W. Goodman, MD, author of A Clinical Overview of Off-label Use of Gabapentinoid Drugs Full Article
ga JAMA Psychiatry : Efficacy of Short-term Treatment of Internet and Computer Game Addiction By traffic.libsyn.com Published On :: Wed, 10 Jul 2019 15:00:00 +0000 Interview with Klaus Wölfling, PhD, author of Efficacy of Short-term Treatment of Internet and Computer Game Addiction: A Randomized Clinical Trial Full Article
ga JAMA Ophthalmology : Progression of Stargardt Disease as Determined by Fundus Autofluorescence Over a 12-Month Period By traffic.libsyn.com Published On :: Thu, 01 Aug 2019 15:00:00 +0000 Interview with Hendrik Scholl, M.D., M.A., author of Progression of Stargardt Disease as Determined by Fundus Autofluorescence Over a 12-Month Period: ProgStar Report No. 11 Full Article
ga JAMA Oncology : Women’s Representation Among Lead Investigators of Clinical Trials in Oncology By traffic.libsyn.com Published On :: Thu, 08 Aug 2019 15:00:00 +0000 Interview with Emma B. Holliday, MD, author of Women’s Representation Among Lead Investigators of Clinical Trials in Oncology Full Article
ga JAMA Psychiatry : Efficacy and Safety of Transcranial Direct Current Stimulation for Treating Negative Symptoms in Schizophrenia By traffic.libsyn.com Published On :: Wed, 16 Oct 2019 15:00:00 +0000 Interview with Andre Brunoni, MD, PhD, author of Efficacy and Safety of Transcranial Direct Current Stimulation for Treating Negative Symptoms in Schizophrenia: A Randomized Clinical Trial Full Article
ga JAMA Psychiatry : Recreational Marijuana Legalization and Changes in Marijuana Use and Cannabis Use Disorder, 2008-2016 By traffic.libsyn.com Published On :: Wed, 13 Nov 2019 16:00:00 +0000 Interview with Magdalena Cerda, DrPH, author of Association Between Recreational Marijuana Legalization in the United States and Changes in Marijuana Use and Cannabis Use Disorder From 2008 to 2016 Full Article
ga JAMA Internal Medicine : Evaluation of Association Between Gastric Acid Suppression and Risk of Intestinal Colonization With MDROs By traffic.libsyn.com Published On :: Mon, 24 Feb 2020 16:00:00 +0000 Interview with Christina Vandenbroucke-Grauls, MD, PhD, author of Evaluation of the Association Between Gastric Acid Suppression and Risk of Intestinal Colonization With Multidrug-Resistant Microorganisms: A Systematic Review and Meta-analysis, and Todd Campbell Lee, MD MPH, author of Deprescribing Proton Pump Inhibitors: Overcoming Resistance Full Article
ga Focus on effective surveillance of COVID-19, contact-tracing and early diagnosis: Harsh Vardhan tells Tamil Nadu, Telangana and Karnataka By www.thehindu.com Published On :: Fri, 08 May 2020 20:42:21 +0530 The Minister also asked the States to ensure adoption of infection, prevention and control (IPC) practices in all health-care settings to avoid and reduce chances of infections to health-care workers. Full Article Health
ga Sugar exports rise on weak rupee, strong demand from Indonesia, Iran By www.business-standard.com Published On :: Fri, 08 May 2020 02:32:00 +0530 Sugar mills have already dispatched 3.7 million tonnes out of around 4.1 million tonnes of contracts signed for exports in the 2019/20 marketing year ending on September 30 Full Article
ga Stocks to watch: RIL, Tata Motors, RBL Bk, Adani Gas, SBI Cards, SKF India By www.business-standard.com Published On :: Fri, 08 May 2020 08:43:00 +0530 Here's a look at the top stocks that may remain in focus today Full Article
ga Hindalco gains 5% after unit Novelis' Q4 results; brokerages maintain 'buy' By www.business-standard.com Published On :: Fri, 08 May 2020 12:03:00 +0530 Novelis informed that its net income attributable to its common shareholder came in at $63 million for the quarter under review, down 39 per cent year-on-year (YoY Full Article
ga 18-yr-old Indian stabbed in Singapore By indianexpress.com Published On :: Sat, 12 Jul 2014 09:13:43 +0000 Full Article DO NOT USE Indians Abroad World
ga Charges dropped against Sikh for carrying Kirpan to airport By indianexpress.com Published On :: Wed, 23 Jul 2014 04:24:13 +0000 Full Article DO NOT USE Indians Abroad World
ga 58 nurses on way back to India, Govt again asks Indians to leave Libya By indianexpress.com Published On :: Fri, 01 Aug 2014 16:33:53 +0000 Full Article DO NOT USE Indians Abroad World
ga Singapore self-help group to counsel Indians on domestic violence By indianexpress.com Published On :: Mon, 04 Aug 2014 04:28:10 +0000 Full Article DO NOT USE Indians Abroad World
ga Gaza-Israel ceasefire enters second day, US supports lasting peace in region By indianexpress.com Published On :: Wed, 06 Aug 2014 06:30:13 +0000 Full Article DO NOT USE Indians Abroad World
ga 2 more charged for Indian man’s murder in Singapore By indianexpress.com Published On :: Sun, 31 Aug 2014 07:03:34 +0000 Full Article DO NOT USE Indians Abroad World
ga Indian-origin politician in race to become Portugal PM By indianexpress.com Published On :: Tue, 30 Sep 2014 09:49:33 +0000 Full Article DO NOT USE Indians Abroad World
ga Eminent Indian named on United Nations probe panel on Gaza By indianexpress.com Published On :: Tue, 11 Nov 2014 04:38:34 +0000 Full Article DO NOT USE Indians Abroad World