Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Include Normalize.css if Bootstrap is not present #269

Closed
wants to merge 2 commits into from
Closed

Include Normalize.css if Bootstrap is not present #269

wants to merge 2 commits into from

Conversation

silvenon
Copy link
Member

@silvenon silvenon commented Feb 6, 2014

I included it instead of Bootstrap because Bootstrap already ships with Normalize. What do we do in the case when Sass & Compass are also present? Because then both Bootstrap and Normalize aren't included, which leaves vendor.css empty again. 😟

Also, do I add Normalize to the description Out of the box I include... or is it unnecessary because Normalize is part of H5BP anyway?

This should fix #242 once it's resolved.

@@ -11,7 +11,8 @@
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css styles/vendor.css -->
<!-- bower:css -->
<% if (includeBootstrap && !includeCompass) { %><link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"><% } %>
<% if (includeBootstrap && !includeCompass) { %><link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"><% }
else if (!includeBootstrap) { %><link rel="stylesheet" href="bower_components/normalize-css/normalize.css" /><% } %>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddiemonge how do I write this according to your standards, i.e. closing the tag on the same line where I'm opening it? Is the only solution writing everything on one line?

@addyosmani
Copy link
Member

I would say we can exclude Normalize from the description.

@silvenon
Copy link
Member Author

silvenon commented Feb 6, 2014

Bootstrap itself ships with Normalize, so including Normalize again would be redundant and would increase the stylesheet's file size. To clarify:

  • no Bootstrap – Normalize should be included
  • Bootstrap (no Sass & Compass) – Normalize should not be included because Bootstrap already has it, but it's not a problem because bootstrap.min.css is included via bower-install, vendor.css will be built
  • Bootstrap + Sass & Compass – Normalize should not be included because Bootstrap already has it, but because Bootstrap is included in main.scss and not via bower-install, vendor.css will not be built

@addyosmani
Copy link
Member

Is it possible to drop all references to vendor.css being included at all for the last case?

@silvenon
Copy link
Member Author

silvenon commented Feb 9, 2014

Yeah, it is. If nobody has a problem with that.

@silvenon
Copy link
Member Author

Done. I tested it (manually) and it works correctly in each combination.

@eddiemonge
Copy link
Member

you are missing bower:css for includebootstrap and compass. bower:css should exist for all options

@silvenon
Copy link
Member Author

Ok, but I'm not happy with this solution. I want to include something when Compass and Bootstrap are present. Can't I just include an empty CSS file to avoid the bad request?

@addyosmani
Copy link
Member

I think we should just include the empty CSS file if it'll avoid any further exceptions being thrown. Does anyone forsee issues with doing that? Would love to finally nail down a solution for this that we can land. It keeps getting reported.

@silvenon
Copy link
Member Author

Isn't that an issue with grunt-usemin? Shouldn't it not try to load an asset that doesn't exist? Or should it create an empty one instead?

@addyosmani
Copy link
Member

I don't think it should try loading an asset that doesn't exist. At the same time, given the slowdown in usemin's release cycle I wonder if we can come to an agreement about a way if fixing this which either involves a workaround factoring in the above discussion or a minor patch to usemin.

@silvenon
Copy link
Member Author

silvenon commented Mar 7, 2014

A minor patch to usemin would solve this problem more efficiently.

@silvenon silvenon closed this Mar 7, 2014
@silvenon silvenon deleted the vendor branch March 12, 2014 19:15
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.

vendor.css file error - Failed to load resource: the server responded with a status of 404 (Not Found)
3 participants