Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

index.html usemin {.tmp,app} css hint causes duplicate styles in dist/styles/main.css #662

Closed
notbrain opened this issue Apr 24, 2014 · 6 comments

Comments

@notbrain
Copy link

In generator-angular / templates / common / index.html

<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->

The {.tmp,app} part causes the resulting dist/styles/<hash>.main.css to be completely duplicated within itself. Works fine using

<!-- build:css styles/main.css -->
@notbrain notbrain changed the title index.html usemin {.tmp,app} css preproc causes duplicate styles in dist/styles/main.css index.html usemin {.tmp,app} css hint causes duplicate styles in dist/styles/main.css Apr 24, 2014
@cebor
Copy link
Contributor

cebor commented Apr 25, 2014

Oh thats right, same here.

<!-- build:css(.tmp) styles/main.css -->

This should fix it correctly.

@notbrain
Copy link
Author

Does the (.tmp) need to be supplied explicitly? There is not one for the preceding vendor.css build hints and it seems to pick those up without specifying (.tmp). Am I not understanding something? Or by default does that pull from app/styles instead of .tmp/styles, since custom main.css might need further processing from .tmp and it doesn't matter for vendor side (and copying from app/styles is fine)?

@cebor
Copy link
Contributor

cebor commented Apr 25, 2014

Yes, by default it will pick up your styles from app/styles, when you want to use the autoprefixer you must specify the (.tmp).

@eddiemonge
Copy link
Member

I don't see the styles being duplicated anywhere. Can you give an example?

@facundocabrera
Copy link

@eddiemonge you could easily reproduce the problem doing the following steps:

  1. yo angular cssduplication

  2. [?] Would you like to use Sass (with Compass)? No

  3. [?] Would you like to include Bootstrap? Yes

  4. [?] Which modules would you like to include? Just include all

  5. Edit the file app/styles/main.css

    .searchme {
      width: 100px;
    }
  6. grunt build

  7. open dist/styles/<hash>.main.css and you should see something like:

    .searchme{width:100px}.searchme{width:100px}

Hope this help to merge the pull request with the fix 😄

@eddiemonge
Copy link
Member

Please help to verify the fixes resolve the issues you have been having. You will need to test using the latest git code. Here are the instructions on how to do that:

  • cd to a testing directory, preferable an empty one

    git clone [email protected]:yeoman/generator-angular.git
    cd generator-angular
    npm link
    cd ..
    mkdir testfonts && cd $_
    yo angular
  • Test the generator with different prompts.

Let me know if you have any issues by replying here or opening a new issue.

jcamelis pushed a commit to jcamelis/generator-angular that referenced this issue Jul 15, 2014
Fix handling of Bootstrap fonts. This correctly loads the fonts in
`grunt serve` as well as `grunt serve:dist`. This should hopefully close
all the PR's and issues related to Bootstrap fonts.

Also removes styles being duplicated in a the output CSS file.

This includes a potentially breaking change in that `root` of **cssmin**
has been reverted (removed).

Closes yeoman#552
Fixes yeoman#638
Fixes yeoman#645
Closes yeoman#661
Fixes yeoman#662
Partially closes yeoman#664
Fixes yeoman#665
Fixes yeoman#667
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 a pull request may close this issue.

4 participants