Comments (4)
Hi Jon,
am I correct in setting the flags, then importing in my main stylesheet again?
That's correct, but it shouldn't result in additional download.
We use the approach outlined here to conditionally include one stylesheet for IE6, IE7, IE8 or IE9+/not-IE.
<!--[if gt IE 8]><!--><link href="<%= asset_path "govuk-template.css" %>" media="screen" rel="stylesheet" type="text/css" /><!--<![endif]-->
<!--[if IE 6]><link href="<%= asset_path "govuk-template-ie6.css" %>" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE 7]><link href="<%= asset_path "govuk-template-ie7.css" %>" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE 8]><link href="<%= asset_path "govuk-template-ie8.css" %>" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
This will result in 4 different CSS files being generated, but only one should be downloaded by a user. If you're following the same pattern in your application CSS files you'll need to repeat the conditional logic.
Does that help?
from govuk_frontend_toolkit.
Thanks @dsingleton. I was missing this little hack ;)
<!--[if gt IE 8]><!--><!--<![endif]-->
from govuk_frontend_toolkit.
@jonhurrell No worries - it's not very clear in our docs, and we should improve it. What would you have found useful, in terms of docs, or examples, or something else?
from govuk_frontend_toolkit.
Some comments here, would have helped. I know of a fair amount of projects that have approached IE/main stylesheets linking similar to my original intent e.g.:
<link rel="stylesheet" href="{{asset_path}}css/style.min.css">
<!--[if IE 8]><link href="{{asset_path}}css/style-ie8.min" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
from govuk_frontend_toolkit.
Related Issues (20)
- Suppress elements deprecation notice HOT 3
- ARIA attributes set by GOVUK.ShowHideContent are invalid HOT 2
- Update stageprompt to use universal tracker HOT 2
- Publishing to govuk_frontend_toolkit_gem and govuk_frontend_toolkit_npm is failing HOT 2
- Favicon missing 48x48 size
- Question about conditional logic on {{ data[] }} HOT 2
- Number names used in CSS as opposed to digits HOT 4
- Document recommended way to use this with python / django HOT 2
- Issue using Frontend Toolkit after updating to jQuery 3.x HOT 6
- Google analytics error HOT 2
- Duplicate OGL links HOT 2
- We need to escape other characters HOT 2
- Breadcrumb link accessibility HOT 2
- Tabs interface needs better way to get to panel content HOT 4
- Google Analytics date regex is very specific HOT 2
- Unable to implement custom trackEvent HOT 1
- What should be used instead of govuk_frontend_toolkit? HOT 3
- Is there any way to integrate to Angular? HOT 2
- The deploy credentials seem to no longer work HOT 4
- Module build failed. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from govuk_frontend_toolkit.