Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Preserve media attribute #106

Merged
merged 1 commit into from
May 15, 2013
Merged

Conversation

louisremi
Copy link
Contributor

I create responsive designs by splitting mobile and desktop css entirely and using the media attribute of the stylesheet links instead of @media rules in the css. So the css part of my index.html usually looks like this:

<!-- build:css(.tmp) styles/style.css -->
<link href="components/normalize-css/normalize.css" rel="stylesheet" type="text/css" />
<link href="styles/index.css" rel="stylesheet" type="text/css" />
<!-- endbuild -->

<!-- build:css(.tmp) styles/mobile.css -->
<link rel="stylesheet" href="styles/mobile.css"  media="(max-width:979px)" />
<!-- endbuild -->
<!-- build:css(.tmp) styles/desktop.css -->
<link rel="stylesheet" href="styles/desktop.css" media="(min-width:980px)" />
<!-- endbuild -->
<!--[if lte IE 8 & (!IEMobile)]>
<link rel="stylesheet" href="/styles/desktop.css" />
<![endif]-->

I need grunt-usemin to preserve the media attribute of the mobile.css and desktop.css links.

This patch does just that. Logically, one block is required per media attribute.

sindresorhus added a commit that referenced this pull request May 15, 2013
@sindresorhus sindresorhus merged commit 252d6f3 into yeoman:master May 15, 2013
@sindresorhus
Copy link
Member

Thanks :)

@sindresorhus
Copy link
Member

@sleeper can you do a quick release?

@louisremi
Copy link
Contributor Author

Great, thanks!

@louisremi louisremi deleted the keep_media branch May 15, 2013 09:21
@sleeper sleeper mentioned this pull request Jul 19, 2013
5 tasks
sleeper added a commit that referenced this pull request Jul 22, 2013
Support of media and defer attribute are now working on v2.0 as well.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants