Skip to content

[Feature Request] Change place where css bundles are injected in index.html or let us specify a media on the angular cli json configuration file #4220

Closed

Description

@luisabreu

OS?

All

Versions.

All

Repro steps.

just build or serve the app

Currently, the served index.html page (ng serve or ng build) injects the css bundles just before the end of the header element. Since there's no way to specify the media type of the stylesheets that are added to the angular-cli configuration file, there's really no way for us to correctly inject a stylesheet for printing in the index.html page (I'd like to add the printer css file after the screen css file, but unless I put both on the page, that will never happen).

So, if the bundles were injected right after the base element (when defined), I'd be able to solve this without loosing the ability to bundle the main css file.

Activity

  1. deebloo commented on Jan 26, 2017

    @deebloo
    Contributor

    @luisabreu could you mark this as a feature request? this may be a candidate for the planned plugin system

  2. luisabreu commented on Jan 26, 2017

    @luisabreu
    Author

    Hello @deebloo. Since I'm not a contributor, I'm under the impression that I can't do that (add a label). Would you mind doing that for me? Btw, is there any workaround for this problem?

    Thanks.

  3. deebloo commented on Jan 26, 2017

    @deebloo
    Contributor

    @luisabreu I can't add tags either, just mention it in the title of the issue. I can't think of a clean workaround at the moment.

  4. changed the title [-]Change place where css bundles are injected in index.html or let us specify a media on the angular cli json configuration file[/-] [+][Feature Request] Change place where css bundles are injected in index.html or let us specify a media on the angular cli json configuration file[/+] on Jan 26, 2017
  5. added
    P5The team acknowledges the request but does not plan to address it, it remains open for discussion
    on Feb 3, 2017
  6. wz2b commented on Mar 8, 2017

    @wz2b

    Is there some kind of workaround for this? Something like:

    <link rel="stylesheet" type="text/css" href="vendor/bootstrap/dist/css/bootstrap.min.css" media="print">

    in index.html? The file itself is in the bundle... it's a little opaque (to me) how it gets placed in the output, or what media type is specified (if any). I have the problem that any printing looks terrible because the bootstrap styles just don't get applied.

  7. filipesilva commented on May 22, 2017

    @filipesilva
    Contributor

    A workaround for this is to add a link tag to a file in assets, but unless there is a more pressing case that needs tag location I don't think a more involved system will be added.

  8. djejaquino commented on Jun 5, 2017

    @djejaquino

    @filipesilva Unfortunately, I can't use fullcalendar.io stylesheet properly because of this issue. Some features, like header buttons do not work properly.

    Take a look at this

  9. webcourse-ng commented on Jun 21, 2019

    @webcourse-ng

    Won't reduce bundle size, but one can add to angular.json a separate css file under styles, with content wrapped in @media print. Helps a bit with organisation.

  10. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions