Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

CSS order inverted when comboed #50

Closed
soljin opened this Issue · 3 comments

2 participants

@soljin

Shaker is generating this url, which is in the exact wrong order:

~/static/julep/assets/compiled/ad-modal_1ec3953846240601a859f392c4766deb.css~/static/julep/assets/compiled/modal_68b9c63ebeef6ef670b0eab39569d806.css~/static/julep/assets/compiled/sprite_01949b9a47cdb6282b373255ca093079.css~/static/julep/assets/compiled/index_43e9a2ff5747cf9f48e8de9c58a050cf.css~/static/julep/assets/compiled/nav_f02b05f0d89248c696fcb06ca3adeb22.css~/static/julep/assets/compiled/article_9270b41ff0ce92a7ae8e739a507cc571.css~/static/julep/assets/compiled/footer_43e9a2ff5747cf9f48e8de9c58a050cf.css~/static/julep/assets/compiled/sprite_01949b9a47cdb6282b373255ca093079.css~/static/julep/assets/compiled/ads_c55f9b3667d8253e8eb3703d0fffc804.css~/static/julep/assets/compiled/base_f54fa80ad5c6e1af53473c55b70acf5a.css~/static/julep/assets/compiled/foundation_8ec7250433e1e3a53c06a4f42c3e91c6.css~/static/julep/assets/compiled/normalize_52d358bd5f53ef2f5a11cfd810399b8c.css

Most notably is the order of normalize, foundation, base and ads. They are added in the controller of my ShakerHTMLFrame child, thusly:

        ...
        ac.assets.addCss('./css/normalize.css');
        ac.assets.addCss('./css/foundation.css');
        ac.assets.addCss('./css/base.css');
        ac.assets.addCss('./css/ads.css');
        ...

Here is my shaker config:

https://gist.github.com/soljin/6276298

Here is my spec config:

https://gist.github.com/soljin/6276306

The order of CSS is pretty important.

@soljin

I'm using mojito-shaker 4.0.25 fom npm and mojito 0.7.2

@soljin

On further inspection it appears that any time a mojit adds assets, those assets are then added to the combo url in the order the mojits were executed and then in alphabetical order.

Defining the assets in the application seems to result in even worse problems. Like duplication and files not being found.

Is there something simple I've messed up in my config?

@aljimenez

Hello,

As you mentioned, the order of the css in the combo url is first the app css followed by the css of each mojit in the order of execution. And within each mojit the order of the css is alphabetical. This is intentional. I've noticed that you are also manually adding assets using ac.assets. You shouldn't have to do this since Shaker automatically adds assets. If you are concerned about the order, then you should name your assets accordingly so that they appear in alphabetical order. Alternatively you can place your assets in a directory called 'void', which tells Shaker to ignore these assets. You can then manually add them using ac.assets and they will appear in the order in which they were added regardless of name. Please let me know if either of these solutions is appropriate for your application.

@aljimenez aljimenez closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.