Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

style-loader/useable: There is a need to be able to control the order of inserting styles. #326

Open

Description

@budarin

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
When call stylesheet.use() - styles added on to a page in order as they were added - one after previous

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
React has a reverse order of calling the component (style.use() called into each component in our project) so there may be a conflict of style overrides.
Styles should be inserted in reversed order - one before previous

If this is a feature request, what is motivation or use case for changing the behavior?
there is no any other ability to control the insertion order of styles

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
"webpack": "4.8.1",
"style-loader": "^0.21.0",
node: 10.0.0
OS: Windows Server 2008R2

Activity

  1. alexander-akait commented on May 9, 2018

    @alexander-akait
    Member

    @budarin I think it is out of scope style-loader, please create minimum reproducible repo with steps in readme (actual and expected behavior). Thanks!

  2. budarin commented on May 9, 2018

    @budarin
    Author

    Hi!

    here it's repo, please try

    I would prefer to add one parameter to use()/ref(0 method - direction (to add above or under the last style tag)

  3. budarin commented on Jun 24, 2018

    @budarin
    Author

    @evilebottnawi
    I'm sorry, but is there any news?

  4. budarin commented on Sep 26, 2018

    @budarin
    Author

    Hi!
    are there any solutions to this problem?

    You can simply solve this problem with addin an empty stylesheet with an id and inserting new styles just after it (when insertAt='bottom' & order='reverse') and just add styles on the top of page's head (when insertAt='top' & order='reverse')

  5. budarin commented on Dec 17, 2018

    @budarin
    Author

    is there anyone here?

  6. alexander-akait commented on Dec 17, 2018

    @alexander-akait
    Member

    @budarin no right now, refactoring style-loader will be after holidays and we can solve this

  7. alexander-akait commented on Dec 17, 2018

    @alexander-akait
    Member

    Anyway feel free to send a PR with PoC for better communication and implementation

  8. budarin commented on Dec 17, 2018

    @budarin
    Author

    thanks for good news :)

  9. modified the milestones: 1.1.0, 2.0.0 on Aug 3, 2019
  10. alexander-akait commented on Aug 3, 2019

    @alexander-akait
    Member

    I think we need new api for this case, let's do it for 2.0.0, anyway feel free to send a PR if you need this as soon as possible

  11. david-minaya commented on Jul 13, 2021

    @david-minaya

    Any news with this? I'm having the same problem

  12. alexander-akait commented on Jul 13, 2021

    @alexander-akait
    Member

    Feel free to send a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions